postgresql / PostgreSQL
PostgreSQL 23505: unique_violation
A duplicate value was inserted into a column or key that must be unique.
Visible symptoms
- SQLSTATE 23505.
- Condition name: unique_violation.
Safe verification and recovery
Check the existing row
Look up the row that already holds the value before inserting.
Handle the code in the application
Test the SQLSTATE 23505 instead of the message text and show a clear duplicate message, or choose a different value.
Matching evidence and limitations
Reported error signals
Matches the documented error signal; it identifies the documented case, not the exact root cause of your request.
The local analyzer never executes suggested commands or treats a possible match as certainty.