↑↓ 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

Reading PG 18current·documented in 9 of 22 versions, 12 to 20

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.

Source: src/backend/utils/errcodes.txt

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.

Source: src/backend/utils/adt/jsonpath_exec.c · Source: src/backend/utils/adt/jsonpath_exec.c · Source: src/backend/utils/adt/jsonpath_exec.c

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

Method: Use catalogue boundary.

Source: src/backend/utils/errcodes.txt

Message templates

ERROR · message.missing-key

Primary

JSON object does not contain key "%s"

Source: src/backend/utils/adt/jsonpath_exec.c

ERROR · message.member-object

Primary

jsonpath member accessor can only be applied to an object

Source: src/backend/utils/adt/jsonpath_exec.c

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. 11 → 12 added

Definition snapshot: english-manuals:87f92d08840f7cc0f7185773604… · English manual source