Supabase "Could not find the table in the schema cache" (PGRST205): how to fix it
Your Lovable, Bolt or Cursor app shows Could not find the table 'public.profiles' in the schema cache (code PGRST205), or Could not find the 'avatar_url' column of 'profiles' in the schema cache (code PGRST204). It worked in preview, or worked before your last change. The error comes from Supabase's Data API (PostgREST), and it means the live database doesn't have the table or column your app asks for, or the API hasn't noticed it yet.
Stuck on this? Get it fixed for €49.
Fixed in 48 hours or you don't pay. Launch deal for the first 5 customers (normally €79). You get the tested fix as a pull request, so nothing changes until you merge it.
Get it fixed for €49Step 1: check the table really exists on this project
Open the Supabase dashboard for the project your live app uses (compare its URL with VITE_SUPABASE_URL or NEXT_PUBLIC_SUPABASE_URL) and run this in the SQL editor:
select table_schema, table_name
from information_schema.tables
where table_name ilike '%profiles%';
No row means the table was never created here. One row in a schema other than public means the app is looking in the wrong place.
1. The migration never ran on the live database
This is the most common cause. The AI tool created the table in a preview or local database, or wrote a migration file that was never applied. Apply it to the live project:
supabase link --project-ref yourprojectref
supabase db push
Or paste the create table (or alter table ... add column) SQL from the migration into the SQL editor. Then add the row-level security policies the table needs, or the next error will be empty data or permission denied (42501).
2. The API's schema cache is out of date
If the table exists but the error stays, the Data API is still using an old copy of your schema. This often happens right after a table or column is added with raw SQL. Tell it to reload:
notify pgrst, 'reload schema';
Wait a few seconds and try again. If you see PGRST002: Could not query the database for the schema cache instead, the database itself is struggling to answer: check the project's health in the dashboard, and see Supabase too many connections.
3. The name doesn't match exactly
Postgres folds unquoted names to lower case. A table created as "UserProfiles" (with quotes) is not the same as userprofiles. Check the exact spelling and case of the table and column names, and of the names in your code:
const { data, error } = await supabase.from('profiles').select('id, avatar_url')
PGRST204 on an insert or update usually means the code sends a field the table doesn't have, such as a typo or a column the AI added in code but never in the database.
4. The table is in a schema the API doesn't expose
By default the Data API only serves the public schema. If the table lives in another schema, either move it, or add the schema under Project Settings then Data API then Exposed schemas, grant access to it, and call it with supabase.schema('myschema').from('table').
Quick checklist
- Confirm which Supabase project the live app uses
- Table and columns exist there, with the exact names the code uses
- Migration applied, plus RLS policies and grants for the new table
- Schema cache reloaded with
notify pgrst, 'reload schema' - Schema exposed in the Data API settings if it isn't
public
Stuck on this? Get it fixed for €49.
Fixed in 48 hours or you don't pay. Launch deal for the first 5 customers (normally €79). You get the tested fix as a pull request, so nothing changes until you merge it.
Get it fixed for €49Still stuck?
Mendlark fixes this kind of problem for a fixed €49 (launch price, normally €79). We agree the problem first, test the fix and send it as a pull request, so nothing changes in your app until you merge it. If we can't fix it, you don't pay. Get the €49 fix, or start with a free scan.
Not sure what else is wrong? Paste your app link into the free instant check and get a plain-English list of problems in seconds.