ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseโ€ข2mo agoโ€ข
11 replies
Udit

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

authSolved
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.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Constraint unique where other column
SupabaseSSupabase / help-and-questions
7mo ago
supabase.auth.api.createUser duplicate key value violates unique constraint users_pkey
SupabaseSSupabase / help-and-questions
4y ago
no unique constraint matching
SupabaseSSupabase / help-and-questions
4y ago
Intermittent 5s Timeout on Supabase Custom Auth Hook (signup): Email Sent, Signup Fails
SupabaseSSupabase / help-and-questions
10mo ago