database
Postgres Errors
Postgres errors use 5-character SQLSTATE codes: 23505 (unique violation), 23503 (foreign key violation), 40P01 (deadlock), 53300 (too many connections), 57P03 (cannot connect now).
Postgres SQLSTATE codes group by class: 08 (connection), 22 (data), 23 (integrity constraint), 40 (transaction rollback), 42 (syntax), 53 (insufficient resources). Most production issues: connection pool exhaustion (53300), deadlocks (40P01), and migration-time constraint violations (23xxx). Use `pg_stat_activity` to debug live.
Database (3)
-
23505Duplicate Key ViolationYour INSERT or UPDATE produced a row whose unique-constrained column(s) already exist in the table. Postgres SQLSTATE 23505 — `unique_violation` — is raised when a UNIQUE or PRIMARY KEY index would otherwise contain duplicate values. -
40P01Deadlock DetectedTwo or more transactions are waiting on locks held by each other in a cycle. Postgres's deadlock detector kills one of them with SQLSTATE 40P01 to break the cycle, rolling back its work. -
53300Too Many ConnectionsPostgres rejected your connection because the server has hit `max_connections`. Each connection consumes ~10MB of RAM plus a backend process; the limit exists to protect the host from memory exhaustion.
Network (1)
Official docs
https://www.postgresql.org/docs/current/errcodes-appendix.html
Support
https://www.postgresql.org/support/