# 2203G — sql_json_item_cannot_be_cast_to_target_type

> Source-backed reference for PostgreSQL SQLSTATE 2203G.
---

# 2203G

## At a glance {#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.

<!-- BEGIN SQLSTATE FACTS: generated by scripts/generate.py; do not edit -->

| 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 | `—` |

<!-- source facts: data/errcodes/2203G.json -->
<!-- END SQLSTATE FACTS -->

## Meaning {#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 {#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 {#messages}
No fixed PostgreSQL 18.6 primary, detail, or hint template was resolved for this definition-only entry.

## Response {#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 {#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.

## Related {#related}
[`2203F`](../2203f/)

## Sources {#sources}
[`src/backend/utils/errcodes.txt#L231`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L231)

The structured [evidence record](../data/evidence/2203g.json) records the fixed definition and the bounded source-scan limit. It contains no runtime observation.
