EC
errcodes.dev
HTTP
PostgreSQL
Linux
Python
Docker
21 languages Β· 7,377+ codes
errcodes.dev
/
PostgreSQL
π
PostgreSQL SQLSTATE Errors
PostgreSQL 17
256 codes
SQLSTATE error codes with SQL fix examples
All severities
ERROR
FATAL
NONE
WARNING
All tiers
Common
Notable
Critical
Showing
256
of
256
errors
Code
Message
Severity
Tier
23505
duplicate key value violates unique constraint
ERROR
Common
β
23503
insert or update on table violates foreign key constraint
ERROR
Common
β
42P01
relation does not exist
ERROR
Common
β
42703
column does not exist
ERROR
Common
β
08006
connection failure
ERROR
Notable
β
28000
invalid authorization specification
FATAL
Common
β
40001
could not serialize access due to concurrent update
ERROR
Notable
β
40P01
deadlock detected
ERROR
Notable
β
22001
value too long for type character varying
ERROR
Common
β
53100
disk full
ERROR
Critical
β
42601
syntax error at or near "..."
ERROR
Common
β
55P03
lock not available
ERROR
Notable
β
22P02
invalid input syntax for type integer
ERROR
Common
β
42501
permission denied for table
ERROR
Common
β
57014
canceling statement due to statement timeout
ERROR
Notable
β
23514
new row for relation violates check constraint
ERROR
Common
β
42710
duplicate object
ERROR
Common
β
42P07
relation already exists
ERROR
Common
β
0A000
feature not supported
ERROR
Common
β
25P02
current transaction is aborted, commands ignored until end of transaction block
ERROR
Common
β
55000
object not in prerequisite state
ERROR
Notable
β
08001
could not connect to server
FATAL
Notable
β
22003
numeric value out of range
ERROR
Common
β
42883
function does not exist
ERROR
Common
β
53200
out of memory
ERROR
Critical
β
42846
cannot cast type
ERROR
Common
β
22007
invalid input syntax for type date
ERROR
Common
β
23502
null value in column violates not-null constraint
ERROR
Common
β
42P18
could not determine data type of parameter $N
ERROR
Common
β
XX000
internal error
ERROR
Critical
β
57P03
the database system is starting up
FATAL
Critical
β
57P01
terminating connection due to administrator command
FATAL
Notable
β
58000
could not open file
ERROR
Critical
β
53300
remaining connection slots are reserved for non-replication superuser connections
FATAL
Notable
β
3D000
database does not exist
FATAL
Common
β
3F000
invalid schema name
ERROR
Common
β
42P16
invalid table definition
ERROR
Common
β
2BP01
cannot drop table because other objects depend on it
ERROR
Common
β
25001
active SQL transaction
ERROR
Common
β
2D000
invalid transaction termination
ERROR
Common
β
00000
successful completion
NONE
β
01000
warning
WARNING
Critical
β
0100C
dynamic result sets returned
WARNING
Critical
β
01008
implicit zero bit padding
WARNING
Critical
β
01003
null value eliminated in set function
WARNING
Critical
β
01007
privilege not granted
WARNING
Critical
β
01006
privilege not revoked
WARNING
Critical
β
01004
string data right truncation
WARNING
Notable
β
01P01
deprecated feature
WARNING
Notable
β
02000
no data
WARNING
Critical
β
02001
no additional dynamic result sets returned
WARNING
β
03000
sql statement not yet complete
WARNING
Critical
β
08000
connection exception
ERROR
Notable
β
08003
connection does not exist
ERROR
Notable
β
08004
sqlserver rejected establishment of sqlconnection
ERROR
Notable
β
08007
transaction resolution unknown
ERROR
Common
β
08P01
protocol violation
ERROR
Notable
β
09000
triggered action exception
ERROR
Notable
β
0B000
invalid transaction initiation
ERROR
Notable
β
0F000
locator exception
ERROR
Critical
β
0F001
invalid locator specification
ERROR
Critical
β
0L000
invalid grantor
ERROR
Notable
β
0LP01
invalid grant operation
ERROR
Notable
β
0P000
invalid role specification
ERROR
Notable
β
0Z000
diagnostics exception
ERROR
Critical
β
0Z002
stacked diagnostics accessed without active handler
ERROR
Critical
β
20000
case not found
ERROR
Notable
β
21000
cardinality violation
ERROR
Notable
β
22000
data exception
ERROR
Notable
β
2202E
array subscript error
ERROR
Notable
β
22021
character not in repertoire
ERROR
Notable
β
22008
datetime field overflow
ERROR
Notable
β
22012
division by zero
ERROR
Notable
β
22005
error in assignment
ERROR
Notable
β
2200B
escape character conflict
ERROR
Notable
β
22022
indicator overflow
ERROR
Critical
β
22015
interval field overflow
ERROR
Notable
β
2201E
invalid argument for logarithm
ERROR
Notable
β
22014
invalid argument for ntile function
ERROR
Notable
β
22016
invalid argument for nth_value function
ERROR
Notable
β
2201F
invalid argument for power function
ERROR
Notable
β
2201G
invalid argument for width_bucket function
ERROR
Notable
β
22018
invalid character value for cast
ERROR
Notable
β
22019
invalid escape character
ERROR
Notable
β
2200D
invalid escape octet
ERROR
Notable
β
22025
invalid escape sequence
ERROR
Notable
β
22P06
nonstandard use of escape character
WARNING
Critical
β
22010
invalid indicator parameter value
ERROR
Critical
β
22023
invalid parameter value
ERROR
Notable
β
22013
invalid preceding or following size in window function
ERROR
Notable
β
2201B
invalid regular expression
ERROR
Notable
β
2201W
invalid row count in LIMIT clause
ERROR
Notable
β
2201X
invalid row count in result offset clause
ERROR
Notable
β
2202H
invalid tablesample argument
ERROR
Notable
β
2202G
invalid tablesample repeat
ERROR
Notable
β
22009
invalid time zone displacement value
ERROR
Notable
β
2200C
invalid use of escape character
ERROR
Notable
β
2200G
most specific type mismatch
ERROR
Notable
β
22004
null value not allowed
ERROR
Notable
β
22002
null value, no indicator parameter
ERROR
Critical
β
2200H
sequence generator limit exceeded
ERROR
Common
β
22026
string data length mismatch
ERROR
Notable
β
22011
substring error
ERROR
Notable
β
22027
trim error
ERROR
Critical
β
22024
unterminated C string
ERROR
Notable
β
2200F
zero length character string
ERROR
Critical
β
22P01
floating point exception
ERROR
Notable
β
22P03
invalid binary representation
ERROR
Notable
β
22P04
bad copy file format
ERROR
Notable
β
22P05
untranslatable character
ERROR
Notable
β
2200L
not an XML document
ERROR
Notable
β
2200M
invalid XML document
ERROR
Notable
β
2200N
invalid XML content
ERROR
Notable
β
2200S
invalid XML comment
ERROR
Critical
β
2200T
invalid XML processing instruction
ERROR
Critical
β
22030
invalid argument for SQL/JSON datetime function
ERROR
Notable
β
22031
invalid argument for SQL/JSON datetime function
ERROR
Notable
β
22032
invalid JSON text
ERROR
Notable
β
22033
invalid SQL/JSON subscript
ERROR
Notable
β
22034
more than one SQL/JSON item
ERROR
Notable
β
22035
no SQL/JSON item
ERROR
Notable
β
22036
non-numeric SQL/JSON item
ERROR
Notable
β
22037
non-unique keys in a JSON object
ERROR
Notable
β
22038
singleton SQL/JSON item required
ERROR
Notable
β
22039
SQL/JSON array not found
ERROR
Notable
β
2203A
SQL/JSON member not found
ERROR
Notable
β
2203B
SQL/JSON number not found
ERROR
Notable
β
2203C
SQL/JSON object not found
ERROR
Notable
β
2203D
too many JSON array elements
ERROR
Notable
β
2203E
too many JSON object members
ERROR
Notable
β
2203F
SQL/JSON scalar required
ERROR
Notable
β
2203G
SQL/JSON item cannot be cast to target type
ERROR
Notable
β
23000
integrity constraint violation
ERROR
Notable
β
23001
restrict violation
ERROR
Notable
β
23P01
exclusion constraint violation
ERROR
Notable
β
24000
invalid cursor state
ERROR
Notable
β
25000
invalid transaction state
ERROR
Notable
β
25002
active SQL transaction
ERROR
Notable
β
25008
held cursor requires same isolation level
ERROR
Notable
β
25003
inappropriate access mode for branch transaction
ERROR
Notable
β
25004
inappropriate isolation level for branch transaction
ERROR
Notable
β
25005
no active SQL transaction for branch transaction
ERROR
Notable
β
25006
read only SQL transaction
ERROR
Notable
β
25007
schema and data statement mixing not supported
ERROR
Notable
β
25P01
no active SQL transaction
ERROR
Notable
β
25P03
idle in transaction session timeout
ERROR
Notable
β
25P04
transaction timeout
ERROR
Notable
β
26000
invalid SQL statement name
ERROR
Notable
β
27000
triggered data change violation
ERROR
Notable
β
28P01
invalid password
FATAL
Notable
β
2B000
dependent privilege descriptors still exist
ERROR
Notable
β
2F000
SQL routine exception
ERROR
Notable
β
2F002
modifying SQL data not permitted
ERROR
Notable
β
2F003
prohibited SQL statement attempted
ERROR
Notable
β
2F004
reading SQL data not permitted
ERROR
Notable
β
2F005
function executed in wrong section of rule
ERROR
Notable
β
34000
invalid cursor name
ERROR
Notable
β
38000
external routine exception
ERROR
Notable
β
38001
containing SQL not permitted
ERROR
Notable
β
38002
modifying SQL data not permitted
ERROR
Notable
β
38003
prohibited SQL statement attempted
ERROR
Notable
β
38004
reading SQL data not permitted
ERROR
Notable
β
39000
external routine invocation exception
ERROR
Notable
β
39001
invalid SQLSTATE returned
ERROR
Notable
β
39004
null value not allowed
ERROR
Notable
β
39P01
trigger protocol violated
ERROR
Notable
β
39P02
SRF protocol violated
ERROR
Notable
β
39P03
event trigger protocol violated
ERROR
Notable
β
3B000
savepoint exception
ERROR
Notable
β
3B001
invalid savepoint specification
ERROR
Notable
β
40000
transaction rollback
ERROR
Notable
β
40002
transaction integrity constraint violation
ERROR
Notable
β
40003
statement completion unknown
ERROR
Common
β
42000
syntax error or access rule violation
ERROR
Notable
β
42803
grouping error
ERROR
Notable
β
42P20
windowing error
ERROR
Notable
β
42P19
invalid recursion
ERROR
Notable
β
42830
invalid foreign key
ERROR
Notable
β
42602
invalid name
ERROR
Notable
β
42622
name too long
ERROR
Notable
β
42939
reserved name
ERROR
Notable
β
42804
datatype mismatch
ERROR
Notable
β
42P21
indeterminate collation
ERROR
Notable
β
42P22
indeterminate datatype
ERROR
Notable
β
42809
wrong object type
ERROR
Notable
β
428C9
generated always
ERROR
Notable
β
42P02
undefined parameter
ERROR
Notable
β
42704
undefined object
ERROR
Notable
β
42701
duplicate column
ERROR
Notable
β
42P03
duplicate cursor
ERROR
Notable
β
42P04
duplicate database
ERROR
Notable
β
42P05
duplicate prepared statement
ERROR
Notable
β
42P06
duplicate schema
ERROR
Notable
β
42P08
ambiguous parameter
ERROR
Notable
β
42P09
ambiguous alias
ERROR
Notable
β
42P10
invalid column reference
ERROR
Notable
β
42P11
invalid cursor definition
ERROR
Notable
β
42P12
invalid database definition
ERROR
Notable
β
42P13
invalid function definition
ERROR
Notable
β
42P14
invalid prepared statement definition
ERROR
Notable
β
42P15
invalid schema definition
ERROR
Notable
β
42P17
invalid object definition
ERROR
Notable
β
44000
WITH CHECK OPTION violation
ERROR
Notable
β
53000
insufficient resources
ERROR
Common
β
53400
configuration limit exceeded
ERROR
Notable
β
54000
program limit exceeded
ERROR
Notable
β
54001
statement too complex
ERROR
Notable
β
54011
too many columns
ERROR
Notable
β
54023
too many arguments
ERROR
Notable
β
55006
object in use
ERROR
Notable
β
55P02
cannot change runtime parameter
ERROR
Notable
β
55P04
unsafe use of new enum value
ERROR
Notable
β
57000
operator intervention
ERROR
Notable
β
57P02
crash shutdown
FATAL
Common
β
57P04
database dropped
FATAL
Common
β
57P05
idle session timeout
FATAL
Notable
β
58030
I/O error
ERROR
Common
β
58P01
undefined file
ERROR
Notable
β
58P02
duplicate file
ERROR
Notable
β
F0000
config file error
FATAL
Common
β
F0001
lock file exists
FATAL
Notable
β
HV000
FDW error
ERROR
Notable
β
HV001
FDW out of memory
ERROR
Notable
β
HV002
FDW dynamic parameter value needed
ERROR
Notable
β
HV004
FDW invalid data type
ERROR
Notable
β
HV005
FDW column name not found
ERROR
Notable
β
HV006
FDW invalid data type descriptors
ERROR
Notable
β
HV007
FDW invalid column name
ERROR
Notable
β
HV008
FDW invalid column number
ERROR
Notable
β
HV009
FDW invalid use of null pointer
ERROR
Notable
β
HV00A
fdw_invalid_string_format
ERROR
Notable
β
HV00B
fdw_invalid_handle
ERROR
Notable
β
HV00C
fdw_invalid_option_index
ERROR
Notable
β
HV00D
fdw_invalid_option_name
ERROR
Notable
β
HV00J
fdw_option_name_not_found
ERROR
Notable
β
HV00K
fdw_reply_handle
ERROR
Notable
β
HV00L
fdw_unable_to_create_execution
ERROR
Notable
β
HV00M
fdw_unable_to_create_reply
ERROR
Notable
β
HV00N
fdw_unable_to_establish_connection
ERROR
Notable
β
HV010
fdw_function_sequence_error
ERROR
Notable
β
HV021
fdw_inconsistent_descriptor_information
ERROR
Notable
β
HV024
fdw_invalid_attribute_value
ERROR
Notable
β
HV090
fdw_invalid_string_length_or_buffer_length
ERROR
Notable
β
HV091
fdw_invalid_descriptor_field_identifier
ERROR
Notable
β
P0000
plpgsql_error
ERROR
Notable
β
P0001
raise_exception
ERROR
Notable
β
P0002
no_data_found
ERROR
Notable
β
P0003
too_many_rows
ERROR
Notable
β
P0004
assert_failure
ERROR
Notable
β
XX001
data_corrupted
ERROR
Common
β
XX002
index_corrupted
ERROR
Common
β
72000
Snapshot too old β query snapshot has expired
ERROR
Notable
β
HV00P
fdw_no_schemas
ERROR
Notable
β
HV00Q
fdw_option_name_not_found
ERROR
Notable
β
HV00R
fdw_unable_to_create_reply
ERROR
Notable
β
LW000
fdw_error (logical replication / LW class)
ERROR
Notable
β