The Prompt BakeryTemplates and prompts

Fix · Supabase and databases

"Database error saving new user" on sign-up

Blocks your work

What you may see

  • Sign-up fails with a database error
  • It started after I added a profile table or a trigger

Most likely cause

A trigger that runs when a user signs up (for example, to create a profile) fails, so the whole sign-up is cancelled.

Check first (about two minutes)

  1. Do you have a function that runs after a new user is created? Open its code.
  2. Check the Postgres logs at the time of the failure.

The fix prompt

What you type here never leaves your browser. The search runs on this page, and nothing is sent to a server or to an AI.

Kept only in this browser, on this device. Keys and passwords are removed before anything is saved.

Prompt language

Paste it into Claude, ChatGPT, Gemini or Cursor, then follow what it says.

After you tried it, did it work?

Steps

  1. Find the trigger on the auth users table and the function it calls.
  2. Read the logs to find the failing statement (often a missing column, a not-null value or a missing permission for the function).
  3. Fix the function in a migration, keep it simple, make it safe to run twice, and give me a rollback file.
  4. Test with a brand-new test email on a test copy.

Do not do this

  • Do not remove the trigger and leave users without profiles unnoticed.
  • Do not delete the auth tables or users.

Related

Try another entry

How can we help?

What do you need?
Your email, so we can reply (optional)Only enter your own email. We reply there.