Your Supabase or Postgres query fails with:
{"code":"42P01","message":"relation \"public.todos\" does not exist"} In the Supabase JS client you may instead see PGRST205: Could not find the table in the schema cache. This one, error 42P01, comes straight from Postgres. It usually appears after a deploy, a migration, or when you point an app at a new project.
What it means
Postgres looked for a table or view with that exact name in the schema it was told to use, and found nothing. "Relation" is Postgres for table, view or sequence. The error is about where the table is, not about permissions.
The 6 usual causes
- The migration never ran in this environment. The table exists locally or in dev, but not in production.
- Wrong project. The app points at a different Supabase project than the one where you created the table.
- Wrong schema. The table is in
privateor a custom schema, and the query defaults topublic. - Case and quoting.
"Todos"andtodosare different names when quoted. Tables created with capital letters need quotes everywhere. - A typo or rename. The code uses an old name after a rename.
- The table was dropped during a reset or a failed migration.
The fix, in order
- In the Supabase dashboard, open the Table Editor and check the exact name and schema.
- Check the project URL in your deployed environment variables.
- Run your migrations on the target project, then redeploy.
- Use lowercase snake_case names so quoting never matters.
- Qualify the schema in SQL (
public.todos) when you are not sure.
Fixes to avoid
- Do not run
supabase db resetagainst a project with real data. It wipes it. - Do not recreate the table by hand in the dashboard and skip row-level security. A table made in a hurry with RLS off is readable by anyone with your public key.
After you recreate a table, turn on RLS and add a policy right away:
alter table public.todos enable row level security; create policy "own rows" on public.todos for all to authenticated using (user_id = auth.uid()) with check (user_id = auth.uid()); Check what is reachable
Recreated tables are a common way to open a database by accident. Test from the outside with only your public anon key: you should get an empty list or a permission error, not rows. The free read-only check at https://proofforge.live looks at a deployed site for open Supabase data, leaked keys and exposed files, and lists what it could not test. To check that one user cannot read another's rows, use the free two-account test: https://proofforge.live/two-account-test
Paid one-time fix reports are $9, $29 and $79, and the free scan does not require them.

