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

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
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” — 22021

character_not_in_repertoire

PostgreSQL error "invalid byte sequence for encoding "UTF8" — 22021" (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
22022 ERROR

Indicator Overflow — SQLSTATE 22022

indicator_overflow

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

Data Exception
22023 ERROR

step size cannot equal zero — 22023

invalid_parameter_value

PostgreSQL error "step size cannot equal zero" (SQLSTATE 22023): what it means, common causes, and how to fix it.

Data Exception
22023 ERROR

cannot extract elements from a scalar — 22023

invalid_parameter_value

PostgreSQL error "cannot extract elements from a scalar" (SQLSTATE 22023): what it means, common causes, and how to fix it.

Data Exception
22023 ERROR

Invalid Parameter Value — SQLSTATE 22023

invalid_parameter_value

A function or setting received an invalid parameter value.

Data Exception
22023 ERROR

parameter “…” requires a Boolean value — 22023

invalid_parameter_value

PostgreSQL error "parameter "…" requires a Boolean value" (SQLSTATE 22023): what it means, common causes, and how to fix it.

Data Exception
22023 ERROR

invalid value for parameter “…”: “…” — 22023

invalid_parameter_value

PostgreSQL error "invalid value for parameter "…": "…"" (SQLSTATE 22023): what it means, common causes, and how to fix it.

Data Exception
22024 ERROR

Unterminated C String — SQLSTATE 22024

unterminated_c_string

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

Data Exception
22025 ERROR

LIKE pattern must not end with escape character — 22025

invalid_escape_sequence

PostgreSQL error "LIKE pattern must not end with escape character" (SQLSTATE 22025): what it means, common causes, and how to fix it.

Data Exception
22025 ERROR

Invalid Escape Sequence — SQLSTATE 22025

invalid_escape_sequence

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

Data Exception
22026 ERROR

String Data Length Mismatch — SQLSTATE 22026

string_data_length_mismatch

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

Data Exception
22027 ERROR

Trim Error — SQLSTATE 22027

trim_error

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

Data Exception
2202E ERROR

array subscript out of range — 2202E

array_subscript_error

PostgreSQL error "array subscript out of range — 2202E" (SQLSTATE 2202E): what it means, common causes, and how to fix it.

Data Exception
2202E ERROR

array subscript out of range — 2202E

array_subscript_error

PostgreSQL error "array subscript out of range" (SQLSTATE 2202E): what it means, common causes, and how to fix it.

Data Exception
2202E ERROR

Array Subscript Error — SQLSTATE 2202E

array_subscript_error

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

Data Exception
2202G ERROR

Invalid Tablesample Repeat — SQLSTATE 2202G

invalid_tablesample_repeat

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

Data Exception
2202H ERROR

Invalid Tablesample Argument — SQLSTATE 2202H

invalid_tablesample_argument

SQLSTATE 2202H (invalid_tablesample_argument): A value is invalid for its data type or the operation applied to it.

Data Exception
22030 ERROR

duplicate JSON object key value — 22030

duplicate_json_object_key_value

PostgreSQL error "duplicate JSON object key value — 22030" (SQLSTATE 22030): what it means, common causes, and how to fix it.

Data Exception
22030 ERROR

duplicate JSON object key value: “…” — 22030

duplicate_json_object_key_value

PostgreSQL error "duplicate JSON object key value: "…"" (SQLSTATE 22030): what it means, common causes, and how to fix it.

Data Exception
22030 ERROR

Duplicate Json Object Key Value — SQLSTATE 22030

duplicate_json_object_key_value

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

Data Exception