Error 23505: unique violation (PostgreSQL)
In short: A record violates a uniqueness rule (UNIQUE or primary key).
In more detail: PostgreSQL code 23505.
In Depth
Possible causes
- Duplicate value in a unique column.
- Sequence not adjusted after import.
Solutions
- Check for existing values beforehand.
- Use
INSERT ... ON CONFLICT. - Reset the sequence.
See also: PostgreSQL, SQL, CRUD