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 576 of 578 errors

P0001 ERROR

… — P0001

raise_exception

PostgreSQL error "…" (SQLSTATE P0001): what it means, common causes, and how to fix it.

PL/pgSQL Error
P0001 ERROR

Raise Exception — SQLSTATE P0001

raise_exception

A user-defined exception was raised by RAISE EXCEPTION.

PL/pgSQL Error
P0001 ERROR

unhandled exception in PL/pgSQL — P0001

raise_exception

PostgreSQL error "unhandled exception in PL/pgSQL — P0001" (SQLSTATE P0001): what it means, common causes, and how to fix it.

PL/pgSQL Error
P0002 ERROR

query returned no rows — P0002

no_data_found

PostgreSQL error "query returned no rows" (SQLSTATE P0002): what it means, common causes, and how to fix it.

PL/pgSQL Error
P0002 ERROR

query returned no rows — P0002

no_data_found

PostgreSQL error "query returned no rows — P0002" (SQLSTATE P0002): what it means, common causes, and how to fix it.

PL/pgSQL Error
P0002 ERROR

No Data Found — SQLSTATE P0002

no_data_found

A PL/pgSQL SELECT INTO STRICT found no rows.

PL/pgSQL Error
P0003 ERROR

query returned more than one row — P0003

too_many_rows

PostgreSQL error "query returned more than one row" (SQLSTATE P0003): what it means, common causes, and how to fix it.

PL/pgSQL Error
P0003 ERROR

query returned more than one row — P0003

too_many_rows

PostgreSQL error "query returned more than one row — P0003" (SQLSTATE P0003): what it means, common causes, and how to fix it.

PL/pgSQL Error
P0003 ERROR

Too Many Rows — SQLSTATE P0003

too_many_rows

A PL/pgSQL SELECT INTO STRICT returned more than one row.

PL/pgSQL Error
P0004 ERROR

assertion failed — P0004

assert_failure

PostgreSQL error "assertion failed" (SQLSTATE P0004): what it means, common causes, and how to fix it.

PL/pgSQL Error
P0004 ERROR

assertion failed — P0004

assert_failure

PostgreSQL error "assertion failed — P0004" (SQLSTATE P0004): what it means, common causes, and how to fix it.

PL/pgSQL Error
P0004 ERROR

Assert Failure — SQLSTATE P0004

assert_failure

A PL/pgSQL ASSERT condition evaluated to false.

PL/pgSQL Error
XX000 ERROR

database is not accepting commands to avoid wraparound data loss — XX000

internal_error

PostgreSQL error "database is not accepting commands to avoid wraparound data loss — XX000" (SQLSTATE XX000): what it means, common causes, and how to fix it.

Internal Error
XX000 PANIC

Internal Error — SQLSTATE XX000

internal_error

PostgreSQL hit an internal error or unexpected state.

Internal Error
XX001 ERROR

found xmin N from before relfrozenxid N — XX001

data_corrupted

PostgreSQL error "found xmin N from before relfrozenxid N" (SQLSTATE XX001): what it means, common causes, and how to fix it.

Internal Error
XX001 ERROR

missing chunk number N for toast value N in pg_toast_N — XX001

data_corrupted

PostgreSQL error "missing chunk number N for toast value N in pg_toast_N" (SQLSTATE XX001): what it means, common causes, and how to fix it.

Internal Error
XX001 ERROR

catalog is missing N attribute(s) for relid N — XX001

data_corrupted

PostgreSQL error "catalog is missing N attribute(s) for relid N" (SQLSTATE XX001): what it means, common causes, and how to fix it.

Internal Error
XX001 ERROR

invalid page in block N of relation … — XX001

data_corrupted

PostgreSQL error "invalid page in block N of relation …" (SQLSTATE XX001): what it means, common causes, and how to fix it.

Internal Error
XX001 ERROR

could not access status of transaction N — XX001

data_corrupted

PostgreSQL error "could not access status of transaction N" (SQLSTATE XX001): what it means, common causes, and how to fix it.

Internal Error
XX001 ERROR

unexpected chunk number N (expected N) for toast value N — XX001

data_corrupted

PostgreSQL error "unexpected chunk number N (expected N) for toast value N" (SQLSTATE XX001): what it means, common causes, and how to fix it.

Internal Error
XX001 ERROR

invalid page in block N of relation … — XX001

data_corrupted

PostgreSQL error "invalid page in block N of relation … — XX001" (SQLSTATE XX001): what it means, common causes, and how to fix it.

Internal Error
XX001 ERROR

found xmin N from before relfrozenxid N — XX001

data_corrupted

PostgreSQL error "found xmin N from before relfrozenxid N — XX001" (SQLSTATE XX001): what it means, common causes, and how to fix it.

Internal Error
XX001 PANIC

Data Corrupted — SQLSTATE XX001

data_corrupted

PostgreSQL detected corrupted data on disk.

Internal Error
XX002 ERROR

index “…” contains unexpected zero page at block N — XX002

index_corrupted

PostgreSQL error "index "…" contains unexpected zero page at block N" (SQLSTATE XX002): what it means, common causes, and how to fix it.

Internal Error