Fix guide · updated 2026-11-15
Supabase "Could not find the table in the schema cache" (PGRST205)
404 · {"code":"PGRST205","details":null,"hint":null,"message":"Could not find the table 'public.todos' in the schema cache"}
A page of your app stays empty or shows an error, and the response says "Could not find the table 'public.todos' in the schema cache", code PGRST205. PostgREST, the part of Supabase that answers database requests, looked for that table among the ones it knows and didn't find it. Four things cause it, and the error's own text tells you which one to check first.
Read the error first
The message names the table it looked for, with its schema in front: 'public.todos'. Sometimes it adds a hint:
- A hint like "Perhaps you meant the table 'public.todo'": a table with a close name exists. See section 2.
- No hint: no table with a similar name exists in that schema. See sections 1, 3 and 4.
We tested it on PostgREST 14.18, the version in Supabase's self-hosted setup. With a table named todos, asking for Todos or todo gave PGRST205 with the hint 'public.todos'. A table created as "Projects", with quotes and a capital, failed as projects, with the hint 'public.Projects'.
1. The table doesn't exist in the project your app uses
A common case with AI-built apps: the code that reads the table exists, but the SQL that creates it never ran on this Supabase project. It happens when you connect your own Supabase project after building, copy or remix the app, or move it to a new project. Two checks:
- Is it the same project? Your app's Supabase URL looks like
https://<project-ref>.supabase.co, and the dashboard's address contains/project/<project-ref>. If the two refs differ, your app talks to another project: fix the URL and key in.envorclient.ts, and in your host's settings (Vercel, Netlify). - Does the table exist? In the right project, open the SQL Editor and run:
select table_schema, table_name
from information_schema.tables
where table_schema not in ('pg_catalog', 'information_schema')
order by 1, 2;
If the table isn't in the list, create it. If your code has a supabase/migrations folder (the Supabase CLI uses one, and AI builders often write one), the SQL is there: search the files for create table and the table's name, read the file, and run it in the SQL Editor. Keep its Row Level Security lines: they're what stops strangers from reading the table. With the Supabase CLI linked to the project, supabase db push applies the migrations that haven't run yet.
2. The name doesn't match exactly
Table names must match exactly: todos isn't todo or Todos. Postgres turns names created without quotes into lowercase (create table Todos makes todos), but keeps quoted names as typed (create table "Projects" makes Projects, which you then have to write with the capital, every time).
The hint gives you the real name. Use it in your code:
// Table created as "Projects"
const { data, error } = await supabase.from('Projects').select();
For new tables, stick to lowercase names with underscores, like user_projects: then the code and the database can't disagree on capitals.
3. The table is in another schema
Unless told otherwise, the request looks in the public schema: that's the public. in the message. Two common cases:
from('users')to read your users. The users Supabase manages live inauth.users, and Supabase doesn't expose the auth schema to the API, for security. For the signed-in user, callsupabase.auth.getUser(). For names and avatars of other users, Supabase's own pattern is apublic.profilestable that a trigger fills at sign-up (Supabase docs, "User Management").- Your own schema, like
api: writesupabase.schema('api').from('todos'), and add the schema to Exposed schemas in Project Settings → Data API. Without that, you get PGRST106 "Invalid schema" instead.
4. The table was just created
PostgREST keeps the list of tables in memory: that's the "schema cache" in the message. On Supabase, creating or changing a table refreshes it by itself: Supabase's Postgres has an event trigger, pgrst_ddl_watch, that sends the reload. If a table you just created is still not found after a few seconds, reload the cache yourself in the SQL Editor:
notify pgrst, 'reload schema';
In our test, a table created after PostgREST started answered PGRST205 until that line ran, then worked.
Which "not found" error do you have?
- PGRST205 "Could not find the table…": PostgREST doesn't know the table. This page.
- 42501 "permission denied for table todos": the table exists, but your app's role has no rights on it. In our test, a table without grants gave 42501, not PGRST205. That happens with new tables when Automatically expose new tables is off in Project Settings → Data API. See Supabase "permission denied for table" (42501).
- PGRST204 "Could not find the 'x' column of 'y'…": the table is there, one of the fields your app saves isn't a column. See Supabase "Could not find the column" (PGRST204).
- PGRST202 "Could not find the function…": the same problem for an
rpc()call: check the function's name, schema and arguments. See Supabase "Could not find the function" (PGRST202). - 42P01 "relation "public.orders" does not exist": not your request, SQL inside the database (a function, a policy, a migration) reads a table that isn't there. See Supabase "relation … does not exist" (42P01).
- PGRST125 "Invalid path specified in request URL": the address itself has the wrong shape. See that guide.
If an AI tool built your app
Run the SQL query from section 1 first, then give your AI tool this prompt with its result pasted in:
My Supabase calls fail with PGRST205 "Could not find the table 'public.<name>' in the schema cache". List every table name used in supabase.from() calls, with the file. Compare them with the tables created in supabase/migrations, and with this list of tables that exist in my project: <paste the query result>. For each name that doesn't match, tell me whether the code uses the wrong name (then fix the name in the code) or the table is missing (then show me the SQL from the migrations that creates it, with its Row Level Security policies, so I can run it myself). Don't change anything else.
Still stuck?
In your browser's developer tools, Network tab, the failing request's address shows the exact table name, right after /rest/v1/. Compare it letter by letter with the name in the Table Editor of the same project.
Other Supabase problems? See Supabase fixes.