Supabase relation does not exist: schema-qualify or fix the search_path
The table exists in the dashboard but queries say it does not. Agents recreate the table. The real causes: the query runs in the wrong schema, the migration never applied to this database, or the name is case-sensitive and quoted.
Supabase relation does not exist: schema-qualify or fix the search_path
TL;DR
Query the table qualified, unqualified, and from a fresh connection with the default search_path. All three must agree before you call it fixed. The table is visible in the dashboard and the query insists it does not exist.
Use this when you run into the situation in the title.
When not to use this skill: unrelated tasks. It covers only the procedure above.
Steps
- Schema-qualify the table in the query (
public.my_table) and retry. If it works qualified but not bare, the connection's searchpath does not include the schema. Fix the searchpath or keep qualifying.
Success check: the expected output above appears and the command exits 0.
- Confirm the migration applied to this database. Local, branch, and production are different databases; a table created locally does not exist in production until the migration is pushed and applied. Check the migration history on the target.
- Check case sensitivity. Unquoted
MyTablefolds to lowercase in Postgres; a table created quoted as "MyTable" is a different relation. Pick lowercase snake_case names and stop quoting.
- Check you are connected to the right project. Dev, staging, and production connection strings look alike, and agents run migrations against the wrong one more often than anyone admits.
- For functions and views, check the search_path baked into the definition. A function created when the path was different resolves tables differently than your current session.
Compatibility
Tool: Supabase. The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.
Details
"relation does not exist" when the table is right there
Do not recreate it; you will end up with two tables and twice the confusion. The query and the table disagree about where the table lives.
Verification
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.