SupabaseS
Supabase2w ago
Udit

Missing UNIQUE constraint on auth.users email column causing signup failures

Issue: New user signups are failing with "Database error saving new user" (HTTP 500).

Root Cause: The auth.users table is missing a UNIQUE constraint on the email column.
It only has a partial unique index (users_email_partial_key WHERE is_sso_user = false),
but GoTrue's internal code uses ON CONFLICT (email) which requires a full UNIQUE constraint.

Error from Postgres logs:
ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification (SQLSTATE 42P10)

We cannot add the constraint ourselves because:
  • ALTER TABLE auth.users ADD CONSTRAINT users_email_key UNIQUE (email);
  • Returns: "ERROR: 42501: must be owner of table users"
Please add the missing UNIQUE (email) constraint or advise on a workaround.
Was this page helpful?