select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

SQLSTATE / CLASS 22 · DATA EXCEPTION

sql_json_member_not_found

SQLSTATE
2203A
Condition name
sql_json_member_not_found
Class
Data Exception
Source macro
ERRCODE_SQL_JSON_MEMBER_NOT_FOUND
Evidence
Source path confirmed
Analysis & operational context

English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗

<h1>2203A</h1>

At a glance

A named JSON object member cannot be read from the current item. Fixed jsonpath member access distinguishes a missing key from a non-object receiver.

Messages

Representative primary texts are:

Guard Primary
Named key is absent from an object JSON object does not contain key "%s"
Member accessor receives a non-object jsonpath member accessor can only be applied to an object

Meaning

The jpiKey branch searches the current JSON object for the requested key. A missing key raises 2203A in a throwing context; a scalar or other non-object receiver uses the same SQLSTATE with the object-type primary. If structural errors are ignored, the mismatch can be skipped, and if the context is non-throwing the path returns an error result for its caller to handle. This is the named-member boundary; wildcard member access and .keyvalue() use the object-only 2203C path.

Diagnosis

Keep the requested key, the item immediately before the member accessor, and the path mode. A missing key may reflect document shape, while a non-object receiver means the path reached the wrong type. Do not turn a missing member into 22035 no-item or a wildcard/object-method mismatch into 2203C without reading the primary.

Response

Correct the key or normalize/branch on the document shape. Use the path's documented lax or error behavior only when a missing member is an intended input case. If an ERROR occurred in an explicit transaction, roll back or roll back to the existing savepoint before retrying; autocommit can retry the corrected action.

Versions

The locked catalogue records this condition from 12.0; the fixed named-member guards are PostgreSQL 18.6. No natural runtime observation is claimed for this page.

Sources

The fixed named-member lookup, missing-key, non-object, and structural-error branches are jsonpath_exec.c#L1012-1055. The shared strict/lax and throw-return macros are jsonpath_exec.c#L235-249. The structured evidence record binds both exact primaries; no natural runtime was run.

Source evidence

Evidence belongs to the frozen source and runtime versions listed here. It is not a runtime verification of the selected manual version.

2203A is sql_json_member_not_found in SQLSTATE Class 22.

Method: Read fixed definition.

src.errcodes.18.6

The fixed named-member jsonpath accessor looks up a key on an object and reports 2203A when the key is absent or the accessor receives a non-object item, unless structural errors are being ignored. A non-throwing jsonpath context can return a path error result; the actual ERROR path carries either the missing-key primary or the object-type primary.

Method: Read the complete jpiKey member lookup, missing-key branch, non-object branch, and structural-error suppression.

Limits: Source confirmation is not a natural runtime observation.

src.jsonpath.member-accessor src.jsonpath.context-flags src.jsonpath.execute-context

The locked catalogue records 2203A from 12.0 without proving exact implementation introduction.

Method: Use catalogue boundary.

src.errcodes.18.6

Message templates

ERROR · message.missing-key

Primary

JSON object does not contain key "%s"
ERROR · message.member-object

Primary

jsonpath member accessor can only be applied to an object

Reproduction & repair cases

No reproduction case is attached to this condition.

Recorded runtime evidence

No runtime observation is attached to this entry.

Version history 1
  1. PG 11 → 12added

Definition snapshot: english-manuals:0136746961b6e08249ad135ce61… · English manual source