# 22035 — no_sql_json_item

> Source-backed reference for PostgreSQL SQLSTATE 22035.
---

# 22035

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

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

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

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

## Messages {#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 {#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 {#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 {#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 {#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 {#related}
[`22033`](../22033/), [`22034`](../22034/)

## Sources {#sources}
JSON path helpers mark empty results in [`src/backend/utils/adt/jsonpath_exec.c#L3880-4070`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/jsonpath_exec.c#L3880). SQL/JSON ON EMPTY/ON ERROR handling and the two 22035 primaries are in [`src/backend/executor/execExprInterp.c#L4940-5080`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execExprInterp.c#L4940). The structured [evidence record](../data/evidence/22035.json) retains the empty-result and behavior boundary; no natural runtime was run.
