Skip to content
ohsudo

Tags

#sequences

duplicate key value
Databases

PostgreSQL "duplicate key value violates unique constraint": causes and fixes

Fix "duplicate key value violates unique constraint" in PostgreSQL: tell a real duplicate from a sequence that is out of sync, and fix both safely.

Intermediate · 4 min read