PostgreSQL Error Reference

Every error, explained

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

3908 errors documentedFree diagnostics on every pageAll PG versions covered

Showing 888 of 3908 errors

2201E ERROR

Invalid Argument For Logarithm — SQLSTATE 2201E

invalid_argument_for_logarithm

SQLSTATE 2201E (invalid_argument_for_logarithm): A value is invalid for its data type or the operation applied to it.

Data Exception
2201E ERROR

cannot take logarithm of zero — 2201E

invalid_argument_for_logarithm

PostgreSQL error "cannot take logarithm of zero" (SQLSTATE 2201E): what it means, common causes, and how to fix it.

Data Exception
2201E ERROR

cannot take logarithm of a negative number — 2201E

invalid_argument_for_logarithm

PostgreSQL error "cannot take logarithm of a negative number" (SQLSTATE 2201E): what it means, common causes, and how to fix it.

Data Exception
2201F ERROR

Invalid Argument For Power Function — SQLSTATE 2201F

invalid_argument_for_power_function

SQLSTATE 2201F (invalid_argument_for_power_function): A value is invalid for its data type or the operation applied to it.

Data Exception
2201F ERROR

zero raised to a negative power is undefined — 2201F

invalid_argument_for_power_function

PostgreSQL error "zero raised to a negative power is undefined" (SQLSTATE 2201F): what it means, common causes, and how to fix it.

Data Exception
2201F ERROR

cannot take square root of a negative number — 2201F

invalid_argument_for_power_function

PostgreSQL error "cannot take square root of a negative number" (SQLSTATE 2201F, invalid_argument_for_power_function): what it means, common causes, and how to fix it.

Data Exception
2201F ERROR

a negative number raised to a non-integer power yields a complex re… — 2201F

invalid_argument_for_power_function

PostgreSQL error "a negative number raised to a non-integer power yields a complex result" (SQLSTATE 2201F, invalid_argument_for_power_function): what it means, common causes, and how to fix it.

Data Exception
2201G ERROR

Invalid Argument For Width Bucket Function — SQLSTATE 2201G

invalid_argument_for_width_bucket_function

SQLSTATE 2201G (invalid_argument_for_width_bucket_function): A value is invalid for its data type or the operation applied to it.

Data Exception
2201G ERROR

count must be greater than zero — 2201G

invalid_argument_for_width_bucket_function

PostgreSQL error "count must be greater than zero" (SQLSTATE 2201G, invalid_argument_for_width_bucket_function): what it means, common causes, and how to fix it.

Data Exception
2201G ERROR

lower and upper bounds must be finite — 2201G

invalid_argument_for_width_bucket_function

PostgreSQL error "lower and upper bounds must be finite" (SQLSTATE 2201G, invalid_argument_for_width_bucket_function): what it means, common causes, and how to fix it.

Data Exception
2201G ERROR

lower bound cannot equal upper bound — 2201G

invalid_argument_for_width_bucket_function

PostgreSQL error "lower bound cannot equal upper bound" (SQLSTATE 2201G, invalid_argument_for_width_bucket_function): what it means, common causes, and how to fix it.

Data Exception
2201G ERROR

operand, lower bound, and upper bound cannot be NaN — 2201G

invalid_argument_for_width_bucket_function

PostgreSQL error "operand, lower bound, and upper bound cannot be NaN" (SQLSTATE 2201G, invalid_argument_for_width_bucket_function): what it means, common causes, and how to fix it.

Data Exception
2201G ERROR

lower and upper bounds cannot be NaN — 2201G

invalid_argument_for_width_bucket_function

PostgreSQL error "lower and upper bounds cannot be NaN" (SQLSTATE 2201G, invalid_argument_for_width_bucket_function): what it means, common causes, and how to fix it.

Data Exception
2201W ERROR

Invalid Row Count In Limit Clause — SQLSTATE 2201W

invalid_row_count_in_limit_clause

SQLSTATE 2201W (invalid_row_count_in_limit_clause): A value is invalid for its data type or the operation applied to it.

Data Exception
2201W ERROR

LIMIT must not be negative — 2201W

invalid_row_count_in_limit_clause

PostgreSQL error "LIMIT must not be negative" (SQLSTATE 2201W, invalid_row_count_in_limit_clause): what it means, common causes, and how to fix it.

Data Exception
2201W ERROR

row count cannot be null in FETCH FIRST … WITH TIES clause — 2201W

invalid_row_count_in_limit_clause

PostgreSQL error "row count cannot be null in FETCH FIRST ... WITH TIES clause" (SQLSTATE 2201W, invalid_row_count_in_limit_clause): what it means, common causes, and how to fix it.

Data Exception
2201X ERROR

Invalid Row Count In Result Offset Clause — SQLSTATE 2201X

invalid_row_count_in_result_offset_clause

SQLSTATE 2201X (invalid_row_count_in_result_offset_clause): A value is invalid for its data type or the operation applied to it.

Data Exception
2201X ERROR

OFFSET must not be negative — 2201X

invalid_row_count_in_result_offset_clause

PostgreSQL error "OFFSET must not be negative" (SQLSTATE 2201X, invalid_row_count_in_result_offset_clause): what it means, common causes, and how to fix it.

Data Exception
22021 ERROR

invalid byte sequence for encoding “…”: … — 22021

character_not_in_repertoire

PostgreSQL error "invalid byte sequence for encoding "…": …" (SQLSTATE 22021): what it means, common causes, and how to fix it.

Data Exception
22021 ERROR

invalid byte sequence for encoding “UTF8”: 0x… — 22021

character_not_in_repertoire

PostgreSQL error "invalid byte sequence for encoding "UTF8": 0x…" (SQLSTATE 22021): what it means, common causes, and how to fix it.

Data Exception
22021 ERROR

Character Not In Repertoire — SQLSTATE 22021

character_not_in_repertoire

SQLSTATE 22021 (character_not_in_repertoire): A value is invalid for its data type or the operation applied to it.

Data Exception
22021 ERROR

invalid multibyte character for locale — 22021

character_not_in_repertoire

PostgreSQL error "invalid multibyte character for locale" (SQLSTATE 22021, character_not_in_repertoire): what it means, common causes, and how to fix it.

Data Exception
22021 ERROR

invalid byte value for encoding “…”: 0xn — 22021

character_not_in_repertoire

PostgreSQL error "invalid byte value for encoding "…": 0xn" (SQLSTATE 22021, character_not_in_repertoire): what it means, common causes, and how to fix it.

Data Exception
22021 ERROR

conversion from wchar_t to server encoding failed: the OS error — 22021

character_not_in_repertoire

PostgreSQL error "conversion from wchar_t to server encoding failed: the OS error" (SQLSTATE 22021, character_not_in_repertoire): what it means, common causes, and how to fix it.

Data Exception