Free1APKAI SUPER PLATFORM

postgresql / PostgreSQL

PostgreSQL 23505: unique_violation

A duplicate value was inserted into a column or key that must be unique.

Cover: PostgreSQL 23505: unique_violation

Visible symptoms

  • SQLSTATE 23505.
  • Condition name: unique_violation.

Safe verification and recovery

  1. Check the existing row

    Look up the row that already holds the value before inserting.

  2. 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.

Verified source list

Analyze a redacted excerpt locally All PostgreSQL errors