SQLSTATE reference
Every PostgreSQL error, indexed by class
PostgreSQL groups every error code into a two-character class. Below is the full catalog, organized the same way the official manual is — jump to a class, then open any code for the lab-reproduced explanation.
Class 08 · Connection Exception
2 codesClass 0A · Feature Not Supported
1 codeClass 21 · Cardinality Violation
1 codeClass 22 · Data Exception
12 codesValue too long for character varying(n)
Numeric value out of range
Null value not allowed
Invalid datetime format
Datetime field overflow
Negative substring length not allowed
Division by zero
Invalid regular expression
LIMIT must not be negative
date_trunc invalid field
String data length mismatch
Invalid input syntax
Class 23 · Integrity Constraint Violation
5 codesClass 25 · Invalid Transaction State
6 codesCOPY FREEZE with prior transaction activity
Active SQL transaction
Read-only SQL transaction
No active SQL transaction
Current transaction is aborted, commands ignored until end of transaction block
Idle in transaction session timeout
Class 28 · Invalid Authorization Specification
1 codeClass 2B · Dependent Privilege Descriptors Still Exist
1 codeClass 34 · Other
1 codeClass 3D · Invalid Catalog Name
1 codeClass 3F · Invalid Schema Name
1 codeClass 40 · Transaction Rollback
2 codesClass 42 · Syntax Error or Access Rule Violation
13 codesPermission denied
Syntax error
Column specified more than once
Column reference is ambiguous
Column does not exist
Duplicate object
UNION types cannot be matched
Cannot coerce
Function does not exist
Cannot insert a non-DEFAULT value into a GENERATED ALWAYS column
Relation does not exist
Undefined parameter
Relation already exists