Skip to content
>_VibeUnstuck

Could not find the column in the schema cache

Last verified:

The fix

PostgREST refused a write because that column name is not in its schema cache. The body is PGRST204: Could not find the 'title' column of 'posts' in the schema cache.

  1. 1

    Read the column and the table out of the message

    The first quoted word is the key your app sent. The second is the table. In the Network tab, the failed request to /rest/v1/<table> shows that key in the JSON body. Confirm the code is PGRST204. A body of PGRST205 is the missing-table page. Do not rename columns in a loop until one sticks.

  2. 2

    Compare that key to the real columns

    Run the select below in the SQL Editor, with your table name. The column_name values are what the client is allowed to send, including case. userId does not match user_id. titleText does not match titletext unless you created the column with double quotes. Change the object you pass to insert, update, or upsert so every key is one of those names. Drop keys that are not columns, such as a nested relation or a form-only field.

    select column_name
    from information_schema.columns
    where table_schema = 'public'
      and table_name = 'posts'
    order by ordinal_position;
  3. 3

    Add the column only if it was never created

    If the list has no row for the field you mean, the migration did not run on this project. Add the column in a migration, with an unquoted snake_case name, then send that name from the client. Do not add a second column in camelCase beside the one you already have. A missing column is not fixed by turning off Row Level Security.

  4. 4

    Reload the schema cache if the column is already there

    If information_schema lists the column and the API still returns PGRST204, the cache is stale. Supabase's reload note says to run the notify below in the SQL Editor. Retry the write after it returns Success. No rows returned. Do not restart the project first. A 42703 from a select is Postgres, not a stale cache: the name in the query is wrong, or the column is in another schema.

    NOTIFY pgrst, 'reload schema';

Why it happens

PostgREST's error reference lists PGRST204 as HTTP 400 in the schema-cache group. The body people get on an insert, update, or upsert is Could not find the 'title' column of 'posts' in the schema cache, with your column and table names in the quotes. PostgREST checks each key in the write against the cache before it builds the SQL. A key that is not a column of that table stops there. hint is null. There is no "did you mean" line.

The same reference's PGRST205 is a missing table, Could not find the table 'public.profiles' in the schema cache. That is a different page. A select or filter that names a missing column is usually Postgres itself, SQLSTATE 42703, message column "title" does not exist. An insert that reaches Postgres with a bad column says column "title" of relation "posts" does not exist. The name is still wrong. The code tells you whether PostgREST or Postgres answered.

Generated clients send titleText or userId to a column created as title or user_id. Unquoted SQL folds to lower case, so add column titleText text creates titletext, while the client still sends titleText. A column added in the SQL Editor can also be invisible to the API until the schema cache reloads. Supabase's reload note is NOTIFY pgrst, 'reload schema'; in the SQL Editor, and the result is Success. No rows returned. Reloading does nothing if information_schema.columns has no such column.

The next error you'll probably hit

Once this is fixed, the usual follow-up is relation "public.profiles" does not exist. relation "public.profiles" does not exist (42P01): that table is missing here. PGRST205 means the schema cache lacks it. Run the migration on this project.

Prompt to paste back into your AI tool

Paste this above the error.

Supabase/PostgREST returns 400 PGRST204: Could not find the 'COLUMN' column of 'TABLE' in the schema cache. If the code is 42703 and the message is column "COLUMN" does not exist, say that instead.

Do not disable RLS. Do not grant the service role to the browser. Do not add a duplicate camelCase column. Do not reload the schema cache before checking information_schema. Do not swallow the error and show an empty form.

1. List column_name from information_schema.columns for this table and schema.
2. If the name the client sends is not in that list, change the insert/update/upsert keys to the real column names. Unquoted SQL folds to lower case.
3. If the column is missing entirely, add it in a migration with an unquoted snake_case name and use that name in the client.
4. If the column is already in information_schema and the code is still PGRST204, tell me to run NOTIFY pgrst, 'reload schema'; in the SQL Editor.
5. Change only that write and, if needed, that one migration.

Common questions

+The Table Editor shows the column and the API still says PGRST204. Why?

The Data API answers from PostgREST's schema cache. If information_schema.columns already has that exact column_name, run NOTIFY pgrst, 'reload schema'; in the SQL Editor and retry the write. If the column_name differs by case or by an underscore, the cache is not the bug. Send the name the table has.

+Select says column does not exist (42703). Is that PGRST204?

No. 42703 is Postgres. The select, filter, or SQL statement named a column the database does not have. PGRST204 is PostgREST rejecting a write key, or a columns parameter, against its cache. Compare the name to information_schema either way. A missing table is PGRST205 or relation does not exist.

+I added the column as titleText in the SQL Editor. Why does titleText still fail?

An unquoted identifier is folded to lower case, so the column is titletext. A quoted "titleText" keeps that case and the client must send titleText. Prefer an unquoted title_text, and send title_text from the app.

Related errors