PostgreSQL Error Reference

Every error, explained

SQLSTATE codes, condition names, root causes, diagnostic queries, and recovery steps — structured for engineers running PostgreSQL in production.

13 errors documentedFree diagnostics on every pageAll PG versions covered

Showing 13 of 13 errors

08P01 ERROR

invalid DESCRIBE message subtype n — 08P01

protocol_violation

PostgreSQL error "invalid DESCRIBE message subtype n" (SQLSTATE 08P01, protocol_violation): what it means, common causes, and how to fix it.

Connection Exception
0A000 ERROR

concurrent index creation for exclusion constraints is not supported — 0A000

feature_not_supported

PostgreSQL error "concurrent index creation for exclusion constraints is not supported" (SQLSTATE 0A000, feature_not_supported): what it means, common causes, and how to fix it.

Feature Not Supported
0LP01 ERROR

cannot set privileges of multirange types — 0LP01

invalid_grant_operation

PostgreSQL error "cannot set privileges of multirange types" (SQLSTATE 0LP01, invalid_grant_operation): what it means, common causes, and how to fix it.

Invalid Grantor
0LP01 ERROR

grant options cannot be granted back to your own grantor — 0LP01

invalid_grant_operation

PostgreSQL error "grant options cannot be granted back to your own grantor" (SQLSTATE 0LP01, invalid_grant_operation): what it means, common causes, and how to fix it.

Invalid Grantor
22000 ERROR

result of range difference would not be contiguous — 22000

data_exception

PostgreSQL error "result of range difference would not be contiguous" (SQLSTATE 22000, data_exception): what it means, common causes, and how to fix it.

Data Exception
22016 ERROR

argument of nth_value must be greater than zero — 22016

invalid_argument_for_nth_value_function

PostgreSQL error "argument of nth_value must be greater than zero" (SQLSTATE 22016, invalid_argument_for_nth_value_function): what it means, common causes, and how to fix it.

Data Exception
22023 ERROR

proto_version “…” out of range — 22023

invalid_parameter_value

PostgreSQL error "proto_version "…" out of range" (SQLSTATE 22023, invalid_parameter_value): what it means, common causes, and how to fix it.

Data Exception
24000 ERROR

portal “…” does not return tuples — 24000

invalid_cursor_state

PostgreSQL error "portal "…" does not return tuples" (SQLSTATE 24000, invalid_cursor_state): what it means, common causes, and how to fix it.

Invalid Cursor State
42501 ERROR

must be superuser to call …() — 42501

insufficient_privilege

PostgreSQL error "must be superuser to call …()" (SQLSTATE 42501, insufficient_privilege): what it means, common causes, and how to fix it.

Syntax Error or Access Rule Violation
42601 ERROR

ON CONFLICT DO UPDATE requires inference specification or constrain… — 42601

syntax_error

PostgreSQL error "ON CONFLICT DO UPDATE requires inference specification or constraint name" (SQLSTATE 42601, syntax_error): what it means, common causes, and how to fix it.

Syntax Error or Access Rule Violation
42P17 ERROR

cast function must not be volatile — 42P17

invalid_object_definition

PostgreSQL error "cast function must not be volatile" (SQLSTATE 42P17, invalid_object_definition): what it means, common causes, and how to fix it.

Syntax Error or Access Rule Violation
55006 ERROR

database “…” is being used by prepared transactions — 55006

object_in_use

PostgreSQL error "database "…" is being used by prepared transactions" (SQLSTATE 55006, object_in_use): what it means, common causes, and how to fix it.

Object Not In Prerequisite State
XX001 ERROR

uncommitted xmin n needs to be frozen — XX001

data_corrupted

PostgreSQL error "uncommitted xmin n needs to be frozen" (SQLSTATE XX001, data_corrupted): what it means, common causes, and how to fix it.

Internal Error