Short answer
Add a foreign key from one table to the other, then reload the schema cache with NOTIFY pgrst, 'reload schema'. Check the table name in your select matches exactly, and that both tables are in an exposed schema. If two foreign keys link the same tables, name the one to use with table!constraint_name(...).
Rather not fix it yourself? App Fix Ticket starts with a fixed-price diagnosis, then a fixed price for the fix before any fix work.
Why the relationship is not found, and the fix
01
There is no foreign key between the tables
“The APIs will automatically detect relationships based on the foreign keys” Supabase, Joins and nested tables
A column called author_id isn’t enough on its own. The API follows foreign key constraints, not column names, so add the constraint.
alter table posts add constraint posts_author_id_fkey foreign key (author_id) references profiles (id);02
The schema cache is stale
“Caused by stale foreign key relationships, otherwise any of the embedding resources or the relationship itself may not exist in the database.” Supabase, PostgREST error codes (PGRST200)
A foreign key added a moment ago may not be in the API’s cached schema yet. Reload it from the SQL editor, then run the query again.
NOTIFY pgrst, 'reload schema';03
The name in the select is wrong
The name inside select() has to match the table name exactly. A typo, a plural where the table is singular, or capital letters in a name Postgres stored in lowercase all give PGRST200.
// table is profiles, not profile or Profiles const { data, error } = await supabase .from('posts') .select('id, title, profiles(name)');04
Two foreign keys link the same tables
“Choose which foreign key relationship to use when multiple foreign keys match the join.” Supabase, Joins and nested tables
If posts has both author_id and editor_id pointing at profiles, the API can’t pick one and answers PGRST201 instead. Name the constraint to use, and give each join an alias.
await supabase .from('posts') .select('id, author:profiles!posts_author_id_fkey(name), editor:profiles!posts_editor_id_fkey(name)');05
The table is in another schema
A table in a schema the API doesn’t expose isn’t in the schema cache at all. The common case is a foreign key to auth.users: the auth schema isn’t exposed, so join through a public.profiles table that references auth.users instead. For your own schemas, expose them in the API settings.
Checked against the vendor’s docs on : Supabase docs: PostgREST error codes; Supabase docs: Joins and nested tables; Supabase troubleshooting: Reload the PostgREST schema; Supabase troubleshooting: Objects in an exposed schema.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
Related: Supabase “Could not find the table in the schema cache” · Supabase “Could not find the function” (PGRST202) · Supabase PGRST116 · Supabase PGRST204 column not found