🔧 Unbreak My AppAll fixesFix KitsSponsor

Fixes › Database / Supabase RLS

Postgres error: relation "public.xyz" does not exist

LovableBoltCursorv0

The error

ERROR: 42P01: relation "public.profiles" does not exist / PostgREST could not find the table

Why it happens

The AI builder wrote TypeScript that queries a table, but the CREATE TABLE migration was never run on this Supabase project (or was run on a different project). Local/SQL editor and production can also point at different databases. PostgREST only exposes tables that exist in the linked project's schema cache.

How to fix it

  1. Open Supabase → Table Editor and confirm the table is missing on this project.
  2. Find the migration or SQL the AI generated (often in supabase/migrations or a setup.sql).
  3. Run it in the SQL Editor for the SAME project whose URL/anon key your app uses, or use supabase db push.
  4. In Project Settings → API, click 'Reload schema' if the table exists but the API still 404s.
  5. Double-check NEXT_PUBLIC_SUPABASE_URL matches this project, not a leftover demo project.

Fix prompt (paste into Lovable, Bolt, Cursor, Replit or v0)

My app errors with relation "<TABLE>" does not exist against Supabase. Do not invent a different schema. Locate every CREATE TABLE / migration for that table, give me one idempotent SQL migration I can paste into the Supabase SQL Editor, list any RLS policies the table needs so selects/inserts work after creation, and tell me how to verify the app's SUPABASE_URL points at the project where I ran the SQL.

FAQ

The table is in my code / types. Why fail?

Types and UI don't create database objects; only a migration or SQL run does.

It works for my teammate.

They likely ran the migration on their project, or you're using different SUPABASE_URL values.

Related fixes

Want the full checklist for this area? Get a Fix Kit ($29)

Get one new fix a week

Free newsletter: the newest breakages in Lovable, Bolt, Cursor, Replit and v0 apps, with paste-in fixes.

We only use your email to send the newsletter. Unsubscribe any time. See privacy.