Database error saving new user

  • Supabase Auth

What it means

Sign-up failed inside the database, not in your app. Usually a trigger that copies each new user into your own table (often profiles) hits an error, and the whole sign-up is rolled back.

Why it happens

  • The trigger inserts into a column that is required but gets no value.
  • The trigger function cannot see your table, because of its search path or permissions.
  • A table or column the trigger uses was renamed or removed.

How to fix it

  1. Check the Postgres logs in Supabase for the real error at the moment of sign-up.
  2. Make the trigger function security definer with an explicit search path, and use full names like public.profiles.
  3. Give required columns defaults, or fill them from the new user's data.

Let your AI find the cause

Paste this into Claude Code, Cursor, Lovable or whichever AI built your app. It looks first and changes nothing until you have read the answer.

Sign-ups in my Supabase app fail with 'Database error saving new user'. Without changing anything yet, find every trigger on auth.users, show me the function each one calls, and tell me which column or permission could make it fail.