↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / SQLSTATE

22035 — no_sql_json_item

A SQL/JSON path found no item for the requested operation. Fixed expression execution reports no SQL/JSON item found for specified path.

English manual coverage begins with PostgreSQL 8.1. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

aliases
Unknown
class name
Data Exception
condition name
no_sql_json_item
lang
en
sqlstate
22035

Definition PG 18

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.

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, 22034

Sources {#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.

Compare versions

SQLSTATE evidence and recorded runtime versions

claims · identity
{
  "claim_id": "identity",
  "limits": "",
  "method": "Read fixed definition.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "22035 is no_sql_json_item in SQLSTATE Class 22."
}
claims · resolved-path
{
  "claim_id": "resolved-path",
  "limits": "Source confirmation is not a natural runtime observation.",
  "method": "Read JsonPathValue empty handling and ExecEvalJsonExprPath ON EMPTY/ON ERROR branches.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.path.0",
    "src.execExpr.json-empty-error"
  ],
  "statement": "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."
}
claims · history
{
  "claim_id": "history",
  "limits": "",
  "method": "Use catalogue boundary.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "The locked catalogue records 22035 from 12.0 without proving exact implementation introduction."
}
messages · message.0
{
  "limits": "",
  "message_id": "message.0",
  "path": "",
  "position": 0,
  "raw": {
    "id": "message.0",
    "primary_template": "no SQL/JSON item found for specified path of column \"%s\"",
    "severity_source": "ERROR",
    "sources": [
      "src.path.0"
    ],
    "sqlstate": "22035"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.0"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "no SQL/JSON item found for specified path of column \" \"",
      "position": 0,
      "role": "",
      "template": "no SQL/JSON item found for specified path of column \"%s\""
    }
  ]
}
messages · message.no-column
{
  "limits": "",
  "message_id": "message.no-column",
  "path": "",
  "position": 1,
  "raw": {
    "id": "message.no-column",
    "primary_template": "no SQL/JSON item found for specified path",
    "severity_source": "ERROR",
    "sources": [
      "src.execExpr.json-empty-error"
    ],
    "sqlstate": "22035"
  },
  "severity": "ERROR",
  "sources": [
    "src.execExpr.json-empty-error"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "no SQL/JSON item found for specified path",
      "position": 0,
      "role": "",
      "template": "no SQL/JSON item found for specified path"
    }
  ]
}
sources · src.errcodes.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/errcodes.txt",
  "position": 0,
  "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
  "source_id": "src.errcodes.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L220"
}
sources · src.path.0
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/executor/execExprInterp.c",
  "position": 1,
  "sha256": "05cbc1cdfd1d091b02045ee55b37147f69be8f0fcb23274751820cc09db33564",
  "source_id": "src.path.0",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execExprInterp.c#L5072"
}
sources · src.execExpr.json-empty-error
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/executor/execExprInterp.c",
  "position": 2,
  "sha256": "05cbc1cdfd1d091b02045ee55b37147f69be8f0fcb23274751820cc09db33564",
  "source_id": "src.execExpr.json-empty-error",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execExprInterp.c#L4940"
}

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · english-manuals:3cc4ccc58787328f41423ea8fb3b20c08c515005980eb6da080920fd59f05ea7

Text language: en · english-manuals:3cc4ccc58787328f41423ea8fb3b20c08c515005980eb6da080920fd59f05ea7