© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
2 replies
Jay Pinho

Identity field throwing error

I imported about 2000 rows from a Google Sheets table, with came with an
id
id
column that was already populated with incrementing integers. When I now try to add an additional row to this table (which I've set as a Primary Key and as an Identity column), I keep getting the "duplicate key value violates unique constraint" error. I've looked around on GitHub and here on Discord for how to solve this, which seems to revolve around resetting the sequence to start at the next
id
id
integer after the max one already in the table, but I cannot for the life of me figure out what SQL query I should be running to do this (or even how to find the name of the "sequence"). Please help?
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

auth.users triggers throwing error.
SupabaseSSupabase / help-and-questions
3y ago
Local sql editor throwing an error
SupabaseSSupabase / help-and-questions
3y ago
GoTrue generateLink throwing idle connection error sporadically
SupabaseSSupabase / help-and-questions
4y ago
Template literals throwing typescript error in V2
SupabaseSSupabase / help-and-questions
4y ago