22035
Read PG 18 manual ↗no_sql_json_item
- SQLSTATE
- 22035
- Condition name
- no_sql_json_item
- Class
- Data Exception
- Source macro
- ERRCODE_NO_SQL_JSON_ITEM
- Evidence
- Source path confirmed
English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗
At a glance
A SQL/JSON path found no item for the requested operation. Fixed expression execution reports no SQL/JSON item found for specified path.
Messages
The ERROR behavior uses these primary texts:
| Context | Primary |
|---|---|
| named JSON_TABLE/SQL/JSON column | no SQL/JSON item found for specified path of column "%s" |
| no column name | no SQL/JSON item found for specified path |
Meaning
A JSON path can produce an empty result without immediately throwing. JsonPathQuery and JsonPathValue mark zero matches as empty; the SQL/JSON expression executor then applies ON EMPTY, or uses a non-ERROR ON ERROR behavior when no separate ON EMPTY behavior is supplied. Only when the effective behavior is ERROR does the executor emit 22035, with a column-aware or column-less primary. Helper functions such as jsonb_path_query_first can return NULL for no match directly, so 22035 is not a blanket synonym for every empty path result.
Diagnosis
Record the operation, path, column name, and its ON EMPTY/ON ERROR clauses. Distinguish an expected NULL/default fallback from an ERROR behavior that reaches 22035. Strict versus lax path evaluation and silent mode can change whether structural problems become an empty result or a suppressed evaluation error; multiple results and invalid subscripts use 22034 and 22033 instead.
Response
If an item is required, correct the path, input document, or column mapping. If no match is valid, use the documented ON EMPTY behavior or a helper whose no-match result is intentionally NULL/empty. Do not add a wrapper to solve a no-item condition; wrappers address multiple-item cardinality. If an ERROR occurred in an explicit transaction, roll back or roll back to the existing savepoint before retrying; autocommit can retry the corrected expression.
Versions
The locked catalogue records this condition from 12.0; the fixed SQL/JSON executor path here is PostgreSQL 18.6. No natural runtime observation is claimed for this page.
Sources
JSON path helpers mark empty results in src/backend/utils/adt/jsonpath_exec.c#L3880-4070. SQL/JSON ON EMPTY/ON ERROR handling and the two 22035 primaries are in src/backend/executor/execExprInterp.c#L4940-5080. The structured evidence record retains the empty-result and behavior boundary; 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.
The fixed SQL/JSON expression executor marks an empty path result and applies ON EMPTY or a non-ERROR ON ERROR behavior; only the ERROR behavior reaches the 22035 ereport, with column-aware and column-less primary variants. JSON path query helpers that return NULL/empty results directly are therefore not blanket 22035 emitters.
Method: Read JsonPathValue empty handling and ExecEvalJsonExprPath ON EMPTY/ON ERROR branches.
Limits: Source confirmation is not a natural runtime observation.
The locked catalogue records 22035 from 12.0 without proving exact implementation introduction.
Method: Use catalogue boundary.
- src/backend/utils/errcodes.txt · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7 - src/backend/executor/execExprInterp.c · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7 - src/backend/executor/execExprInterp.c · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7
Message templates
ERROR · message.0
Primary
no SQL/JSON item found for specified path of column "%s"
ERROR · message.no-column
Primary
no SQL/JSON item found for specified path
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
- PG 11 → 12added
Definition snapshot: english-manuals:ab154f780d93571efcde3c2b8ea… · English manual source