Guided triage
Start from the symptom
You don't always have the SQLSTATE in front of you — you have a hung app, a failing deploy, a rejected write. Pick what you saw and jump straight to the reproduced error, its live diagnostics, and the fix.
Already know the code? Press ⌘K anywhere, or paste the error on the home page.
A transaction keeps aborting or rolling back under concurrency
Writes fail intermittently when more than one session is active. Match the exact message PostgreSQL returned to the failure mode below.
- Two sessions hung, then one was cancelled with a “deadlock detected” cycle message40P01Deadlock detected
- A single-row UPDATE failed with “could not serialize access due to concurrent update”40001Could not serialize access due to concurrent update
- SELECT … FOR UPDATE NOWAIT failed immediately with “could not obtain lock on row”55P03Could not obtain lock on row
- Every statement now errors “current transaction is aborted, commands ignored until end of transaction block”25P02Current transaction is aborted, commands ignored until end of transaction block
- A long statement was killed with “canceling statement due to …”57014Query canceled
- Sessions left open were terminated by “idle-in-transaction timeout”25P03Idle in transaction session timeout
The application can’t connect, or connections keep failing
Connections are refused, dropped, or rejected. Use the exact FATAL/error text to jump to the reproduction.
- “sorry, too many clients already” — the pool exhausted max_connections53300Too many connections
- You raised max_connections but it won’t take effect until restart55P02Cannot change runtime parameter
- A query died mid-flight with “connection to client lost” / broken pipe08006Connection to client lost
- The driver failed at connect with a bind/parameter “message mismatch”08P01Bind message parameter mismatch
- “password authentication failed for user …”28P01Invalid password
- “database "…" does not exist” — connecting to the wrong/absent database3D000Invalid catalog name
An INSERT or UPDATE is rejected by a constraint
The write is syntactically fine but violates an integrity rule. Match the constraint class PostgreSQL named in the error.
- “duplicate key value violates unique constraint”23505Duplicate key value violates unique constraint
- “null value in column … violates not-null constraint”23502Null value in column violates not-null constraint
- “insert or update … violates foreign key constraint”23503Insert or update violates foreign key constraint
- “new row … violates check constraint”23514New row violates check constraint
- “conflicting key value violates exclusion constraint”23P01New row violates exclusion constraint
- “cannot insert a non-DEFAULT value into column … GENERATED ALWAYS”428C9Cannot insert a non-DEFAULT value into a GENERATED ALWAYS column
Every route above lands on a reproduced error with a Diagnose tab of live system-catalog queries, a free fix, and a Pro-gated proof that the fix holds. Not seeing your symptom? Browse all errors.