PostgreSQL Error Reference

Every error, explained

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

578 errors documentedFree diagnostics on every pageAll PG versions covered

Showing 288 of 578 errors

39001 ERROR

Invalid Sqlstate Returned — SQLSTATE 39001

invalid_sqlstate_returned

SQLSTATE 39001 (invalid_sqlstate_returned): An external routine invocation failed.

External Routine Invocation Exception
39004 ERROR

Null Value Not Allowed — SQLSTATE 39004

null_value_not_allowed

SQLSTATE 39004 (null_value_not_allowed): An external routine invocation failed.

External Routine Invocation Exception
39P01 ERROR

Trigger Protocol Violated — SQLSTATE 39P01

trigger_protocol_violated

SQLSTATE 39P01 (trigger_protocol_violated): An external routine invocation failed.

External Routine Invocation Exception
39P02 ERROR

Srf Protocol Violated — SQLSTATE 39P02

srf_protocol_violated

SQLSTATE 39P02 (srf_protocol_violated): An external routine invocation failed.

External Routine Invocation Exception
39P03 ERROR

Event Trigger Protocol Violated — SQLSTATE 39P03

event_trigger_protocol_violated

SQLSTATE 39P03 (event_trigger_protocol_violated): An external routine invocation failed.

External Routine Invocation Exception
3B000 ERROR

Savepoint Exception — SQLSTATE 3B000

savepoint_exception

SQLSTATE 3B000 (savepoint_exception): A savepoint operation is invalid.

Savepoint Exception
3B000 ERROR

prepared transaction with identifier “…” does not exist — 3B000

savepoint_exception

PostgreSQL error "prepared transaction with identifier … does not exist — 3B000" (SQLSTATE 3B000): what it means, common causes, and how to fix it.

Savepoint Exception
3B001 ERROR

Invalid Savepoint Specification — SQLSTATE 3B001

invalid_savepoint_specification

SQLSTATE 3B001 (invalid_savepoint_specification): A savepoint operation is invalid.

Savepoint Exception
3B001 ERROR

savepoint “…” does not exist — 3B001

invalid_savepoint_specification

PostgreSQL error "savepoint "…" does not exist" (SQLSTATE 3B001): what it means, common causes, and how to fix it.

Savepoint Exception
3D000 ERROR

Invalid Catalog Name — SQLSTATE 3D000

invalid_catalog_name

The target database does not exist.

Invalid Catalog Name
3D000 FATAL

database “…” does not exist — 3D000

invalid_catalog_name

PostgreSQL error "database "…" does not exist" (SQLSTATE 3D000): what it means, common causes, and how to fix it.

Invalid Catalog Name
3D000 FATAL

database “…” does not exist — 3D000

invalid_catalog_name

PostgreSQL error "database … does not exist — 3D000" (SQLSTATE 3D000): what it means, common causes, and how to fix it.

Invalid Catalog Name
3F000 ERROR

Invalid Schema Name — SQLSTATE 3F000

invalid_schema_name

The schema does not exist or is not on the search_path.

Invalid Schema Name
3F000 ERROR

schema “…” does not exist — 3F000

invalid_schema_name

PostgreSQL error "schema … does not exist — 3F000" (SQLSTATE 3F000): what it means, common causes, and how to fix it.

Invalid Schema Name
3F000 ERROR

schema “…” does not exist — 3F000

invalid_schema_name

PostgreSQL error "schema "…" does not exist" (SQLSTATE 3F000): what it means, common causes, and how to fix it.

Invalid Schema Name
40000 ERROR

Transaction Rollback — SQLSTATE 40000

transaction_rollback

SQLSTATE 40000 (transaction_rollback): The transaction was rolled back due to a serialization or deadlock conflict.

Transaction Rollback
40001 ERROR

Serialization Failure — SQLSTATE 40001

serialization_failure

The transaction was rolled back due to a serialization conflict.

Transaction Rollback
40001 ERROR

could not serialize access due to concurrent update — 40001

serialization_failure

PostgreSQL error "could not serialize access due to concurrent update" (SQLSTATE 40001): what it means, common causes, and how to fix it.

Transaction Rollback
40001 ERROR

could not serialize access due to read/write dependencies among transactions — 40001

serialization_failure

PostgreSQL error "could not serialize access due to read/write dependencies among transactions" (SQLSTATE 40001): what it means, common causes, and how ...

Transaction Rollback
40001 ERROR

could not serialize access due to read/write dependencies — 40001

serialization_failure

PostgreSQL error "could not serialize access due to read/write dependencies — 40001" (SQLSTATE 40001): what it means, common causes, and how to fix it.

Transaction Rollback
40001 ERROR

canceling statement due to conflict with recovery — 40001

serialization_failure

PostgreSQL error "canceling statement due to conflict with recovery" (SQLSTATE 40001): what it means, common causes, and how to fix it.

Transaction Rollback
40002 ERROR

Transaction Integrity Constraint Violation — SQLSTATE 40002

transaction_integrity_constraint_violation

SQLSTATE 40002 (transaction_integrity_constraint_violation): The transaction was rolled back due to a serialization or deadlock conflict.

Transaction Rollback
40003 ERROR

Statement Completion Unknown — SQLSTATE 40003

statement_completion_unknown

SQLSTATE 40003 (statement_completion_unknown): The transaction was rolled back due to a serialization or deadlock conflict.

Transaction Rollback
40P01 ERROR

deadlock detected — 40P01

deadlock_detected

PostgreSQL error "deadlock detected" (SQLSTATE 40P01): what it means, common causes, and how to fix it.

Transaction Rollback