© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago•
9 replies
Felipe

duplicate key value violates unique constrain

Hi, I'm new to supabase and I'm developping a Flutter App.
I have manage to create table and data and query, but I'm facing an error when trying to insert a new row.
Every time I run the method to insert a new row, a get the following error:
"duplicate key value violates unique constrain".
But the thing is: I'm not passing the id column at all and it is set as unique identity not nullable. I even tried to double check and run SQL prompt to update the id column to 'GENERATED ALWAYS' as described in the docs, and commands runs without any error, but still getting the same error message to insert. Could some please advise me what I'm missing? thanks in adv
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

duplicate key value violates unique constraint Key (id)=(5)
SupabaseSSupabase / help-and-questions
3y ago
duplicate key value violates unique constraint "profiles_pkey"
SupabaseSSupabase / help-and-questions
3y ago
supabase.auth.api.createUser duplicate key value violates unique constraint users_pkey
SupabaseSSupabase / help-and-questions
4y ago
violates foreign key constraint
SupabaseSSupabase / help-and-questions
4y ago