Skip to content

SQLSTATE classes

Browse PostgreSQL conditions by the first two characters of SQLSTATE.

The class index groups codes by the first two SQLSTATE characters. A class describes a broad condition family; it does not prove that every member has the same severity, transaction aftermath, or retry behavior.

The generated member list links to one canonical page per code. A member’s class is directory identity; mechanism and recovery remain on the code page.

Class Name Members
00 Successful Completion 00000
01 Warning 01000, 01003, 01004, 01006, 01007, 01008, 0100C, 01P01
02 No Data (this is also a warning class per the SQL standard) 02000, 02001
03 SQL Statement Not Yet Complete 03000
08 Connection Exception 08000, 08001, 08003, 08004, 08006, 08007, 08P01
09 Triggered Action Exception 09000
0A Feature Not Supported 0A000
0B Invalid Transaction Initiation 0B000
0F Locator Exception 0F000, 0F001
0L Invalid Grantor 0L000, 0LP01
0P Invalid Role Specification 0P000
0Z Diagnostics Exception 0Z000, 0Z002
10 XQuery Error 10608
20 Case Not Found 20000
21 Cardinality Violation 21000
22 Data Exception 22000, 22001, 22002, 22003, 22004, 22005, 22007, 22008, 22009, 2200B, 2200C, 2200D, 2200F, 2200G, 2200H, 2200L, 2200M, 2200N, 2200S, 2200T, 22010, 22011, 22012, 22013, 22014, 22015, 22016, 22018, 22019, 2201B, 2201E, 2201F, 2201G, 2201W, 2201X, 22021, 22022, 22023, 22024, 22025, 22026, 22027, 2202E, 2202G, 2202H, 22030, 22031, 22032, 22033, 22034, 22035, 22036, 22037, 22038, 22039, 2203A, 2203B, 2203C, 2203D, 2203E, 2203F, 2203G, 22P01, 22P02, 22P03, 22P04, 22P05, 22P06
23 Integrity Constraint Violation 23000, 23001, 23502, 23503, 23505, 23514, 23P01
24 Invalid Cursor State 24000
25 Invalid Transaction State 25000, 25001, 25002, 25003, 25004, 25005, 25006, 25007, 25008, 25P01, 25P02, 25P03, 25P04
26 Invalid SQL Statement Name 26000
27 Triggered Data Change Violation 27000
28 Invalid Authorization Specification 28000, 28P01
2B Dependent Privilege Descriptors Still Exist 2B000, 2BP01
2D Invalid Transaction Termination 2D000
2F SQL Routine Exception 2F000, 2F002, 2F003, 2F004, 2F005
34 Invalid Cursor Name 34000
38 External Routine Exception 38000, 38001, 38002, 38003, 38004
39 External Routine Invocation Exception 39000, 39001, 39004, 39P01, 39P02, 39P03
3B Savepoint Exception 3B000, 3B001
3D Invalid Catalog Name 3D000
3F Invalid Schema Name 3F000
40 Transaction Rollback 40000, 40001, 40002, 40003, 40P01
42 Syntax Error or Access Rule Violation 42000, 42501, 42601, 42602, 42611, 42622, 42701, 42702, 42703, 42704, 42710, 42712, 42723, 42725, 42803, 42804, 42809, 42830, 42846, 42883, 428C9, 42939, 42P01, 42P02, 42P03, 42P04, 42P05, 42P06, 42P07, 42P08, 42P09, 42P10, 42P11, 42P12, 42P13, 42P14, 42P15, 42P16, 42P17, 42P18, 42P19, 42P20, 42P21, 42P22
44 WITH CHECK OPTION Violation 44000
53 Insufficient Resources 53000, 53100, 53200, 53300, 53400
54 Program Limit Exceeded 54000, 54001, 54011, 54023
55 Object Not In Prerequisite State 55000, 55006, 55P02, 55P03, 55P04
57 Operator Intervention 57000, 57014, 57P01, 57P02, 57P03, 57P04, 57P05
58 System Error (errors external to PostgreSQL itself) 58000, 58030, 58P01, 58P02, 58P03
72 Snapshot Failure 72000
F0 Configuration File Error F0000, F0001
HV Foreign Data Wrapper Error (SQL/MED) HV000, HV001, HV002, HV004, HV005, HV006, HV007, HV008, HV009, HV00A, HV00B, HV00C, HV00D, HV00J, HV00K, HV00L, HV00M, HV00N, HV00P, HV00Q, HV00R, HV010, HV014, HV021, HV024, HV090, HV091
P0 PL/pgSQL Error P0000, P0001, P0002, P0003, P0004
XX Internal Error XX000, XX001, XX002