Supabase and Postgres error messages, explained
Paste the message you got and find out what it means, why your AI builder caused it and how to fix it without opening a security hole. Every fix is tested on a real database.
Showing 16 of 16
Database (Postgres)
- duplicate key value violates unique constraint "profiles_pkey"Why Supabase says duplicate key value violates unique constraint: a profile created twice, a retried webhook or double click, or an id counter that fell behind.23505
- infinite recursion detected in policy for relation "members"Why a Supabase team app fails with infinite recursion detected in policy for relation members, and the helper function that fixes it without opening member lists.42P17
- insert or update on table "notes" violates foreign key constraint "notes_user_id_fkey"Why Supabase says insert or update violates foreign key constraint, or update or delete violates it, the usual causes, and fixes that keep your data consistent.23503
- new row violates row-level security policy for table "notes"Why Supabase says new row violates row-level security policy on insert, update or upsert, the six usual causes and the fix that keeps your data private.42501
- null value in column "user_id" of relation "notes" violates not-null constraintWhy Postgres says null value in column violates not-null constraint in your Supabase app, the three usual causes, and the fix that keeps every row owned.23502
- permission denied for function get_team_statsWhy supabase.rpc() or a policy fails with permission denied for function, the four usual causes, and how to grant execute without opening admin functions.42501
- permission denied for table notesWhy Supabase says permission denied for table, why new tables hit it since the 2026 Data API change, and the grants that fix it without opening your data.42501
Supabase API
- Cannot coerce the result to a single JSON objectWhy .single() in Supabase fails with PGRST116, also shown as JSON object requested, multiple (or no) rows returned, and the fix that keeps RLS on.PGRST116
- Could not find the table 'public.notes' in the schema cacheWhy Supabase says Could not find the table in the schema cache (PGRST205), the four usual causes, and the fix that does not open private data to the API.PGRST205
- data: [], error: nullYour Supabase select returns an empty array with no error, but the rows are there. The five causes, how to tell RLS from no data, and the policy that fixes it.
- Invalid API keyWhy Supabase answers 401 Invalid API key, what the three hints mean, the four usual causes and how to fix it without putting the secret key in your frontend.401
- JWT expiredWhy Supabase answers JWT expired (PGRST303, HTTP 401), the four usual causes in AI-built apps, and the fix that keeps tokens short-lived and RLS in place.PGRST303
- update() returns error: null, but nothing changesSupabase update() or delete() returns error: null and no row changes. The five usual causes, how .select() makes it visible, and the safe fix.
Sign-in and e-mail
Browser and Edge Functions
Payments (Stripe)
Find this in your own app
ShipRely reads your repository (read-only), proves each finding with file and line, and gives you a fix prompt to paste into your AI builder.
Run a demo audit- Read-only access to your repository
- Every finding with file and line
- Fix prompts for Lovable, Cursor, Claude Code and Bolt