22035 — no_sql_json_item
22035
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.
| Field | Value |
|---|---|
| SQLSTATE | 22035 |
| Condition | no_sql_json_item |
| Status | active |
| Known present by | 12.0 |
| Locked snapshots | 12.22, 13.23, 14.24, 15.19, 16.15, 17.11, 18.6, 19beta3 |
| Macros | ERRCODE_NO_SQL_JSON_ITEM |
| Aliases | — |
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.
Related
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.