Skip to content

2203G — sql_json_item_cannot_be_cast_to_target_type

Source-backed reference for PostgreSQL SQLSTATE 2203G.

2203G

At a glance

2203G is the catalogue condition sql_json_item_cannot_be_cast_to_target_type. In the fixed PostgreSQL 18.6 tree, the bounded search found its macro in errcodes.txt but no core or contrib call that emits it. This is therefore a definition-only reference; a JSON conversion that merely looks similar is not evidence that the server used this SQLSTATE.

Field Value
SQLSTATE 2203G
Condition sql_json_item_cannot_be_cast_to_target_type
Status active
Known present by 15.0
Locked snapshots 15.19, 16.15, 17.11, 18.6, 19beta3
Macros ERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE
Aliases

Meaning

The fixed catalogue gives this condition a SQL/JSON name, but the bounded 18.6 source scan did not find a PostgreSQL core or contrib emitter. It is not safe to turn the name into an invented JSONPath, constructor, scalar/array, or object conversion scenario. An extension or user-defined RAISE can have its own usage, but that is outside the fixed-tree result.

Diagnosis

Capture the exact SQLSTATE, primary/detail/hint, server log context, statement, and the extension or function that produced it. Use that evidence to identify the actual producer; do not classify a JSON syntax, ordinary type-input, or other conversion failure as 2203G from its wording alone.

Messages

No fixed PostgreSQL 18.6 primary, detail, or hint template was resolved for this definition-only entry.

Response

There is no source-backed PostgreSQL-core repair recipe for this definition-only entry. After identifying the real producer, correct that producer’s contract and retry the affected operation. If the producer did emit an ERROR in an explicit transaction, use ROLLBACK or ROLLBACK TO SAVEPOINT before retrying; in autocommit, correct the cause first and then submit the operation again. A connection reset is not implied by this condition definition.

Versions

The locked catalogue records the condition from PostgreSQL 15.0. The fixed source boundary for this review is PostgreSQL 18.6 REL_18_6; the absence of a bounded-tree emitter does not establish when any concrete implementation path was introduced, nor how an extension or a future version behaves.

2203F

Sources

src/backend/utils/errcodes.txt#L231

The structured evidence record records the fixed definition and the bounded source-scan limit. It contains no runtime observation.