↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / SQLSTATE

10608 — invalid_argument_for_xquery

SQLSTATE 10608 is an ERROR-level XQuery-class condition for an invalid argument. PostgreSQL 18.6 has resolved backend XML paths for an empty XPath expression, an empty row path filter, and an empty column path filter. The contrib/xml2 sources also reference the macro, but those references alone do not establish an additional report message.

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
XQuery Error
condition name
invalid_argument_for_xquery
lang
en
sqlstate
10608

Definition PG 18

10608

At a glance {#at-a-glance}

SQLSTATE 10608 is an ERROR-level XQuery-class condition for an invalid argument. PostgreSQL 18.6 has resolved backend XML paths for an empty XPath expression, an empty row path filter, and an empty column path filter. The contrib/xml2 sources also reference the macro, but those references alone do not establish an additional report message.

Meaning {#meaning}

The fixed backend calls report exactly empty XPath expression, row path filter must not be empty string, and column path filter must not be empty string in src/backend/utils/adt/xml.c. These are argument-validation failures in XML/XPath processing. The core report does not imply that every XPath/XSLT or extension argument error uses 10608.

Messages {#messages}

The fixed backend calls report exactly empty XPath expression, row path filter must not be empty string, and column path filter must not be empty string in src/backend/utils/adt/xml.c. These are argument-validation failures in XML/XPath processing. The core report does not imply that every XPath/XSLT or extension argument error uses 10608.

Diagnosis {#diagnosis}

Identify which XML operation supplied the argument and whether the empty value was the XPath expression, row path filter, or column path filter. Preserve the exact message and input shape; for xml2 or another extension, inspect that extension's call path separately because the macro reference is not a report group. Check server version when comparing behavior: the locked catalogue first places 10608 at PostgreSQL 18.0.

Response {#response}

Supply a non-empty expression or filter appropriate to the XML function, then validate the corrected input before repeating the statement. If the operation is extension-owned, use the extension's documented argument rules. This is input repair; a retry without changing the empty argument cannot address the confirmed path.

Versions {#versions}

The locked catalogue places this condition at least by PostgreSQL 18.0. The release definitions cover the published snapshots listed in the facts block; source-path status is limited to the fixed PostgreSQL 18.6 context cited below.

Related {#related}

22023, 0A000

Sources {#sources}

The fixed backend xml.c reports the empty XPath variant and the row/column filter checks report the other variants. contrib/xml2/xpath.c and xslt_proc.c contain macro references. See the XML functions documentation. See the structured evidence record for fixed source paths, scan scope, and unresolved runtime boundaries.

Compare versions

SQLSTATE evidence and recorded runtime versions

claims · identity
{
  "claim_id": "identity",
  "limits": "",
  "method": "Read the fixed errcodes definition row, severity, and macro.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "10608 is invalid_argument_for_xquery in SQLSTATE Class 10."
}
claims · resolved-path
{
  "claim_id": "resolved-path",
  "limits": "This is source confirmation, not a runtime observation in this batch.",
  "method": "Read the complete source context around the resolved report group.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.xml.18.6",
    "src.xml2.xpath.18.6",
    "src.xml2.xslt.18.6"
  ],
  "statement": "The fixed PostgreSQL 18.6 source contains the report path and message context described on the page."
}
claims · history-boundary
{
  "claim_id": "history-boundary",
  "limits": "Definition presence is not an emitting-path observation.",
  "method": "Compare canonical release-definition facts with the available history boundary.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "The locked release definitions establish catalogue presence from the known 18.0 boundary; they do not establish a precise introducing release or runtime use."
}
messages · message.xml-empty-xpath
{
  "limits": "",
  "message_id": "message.xml-empty-xpath",
  "path": "",
  "position": 0,
  "raw": {
    "id": "message.xml-empty-xpath",
    "primary_template": "empty XPath expression",
    "severity_source": "ERROR",
    "sources": [
      "src.xml.18.6"
    ],
    "sqlstate": "10608"
  },
  "severity": "ERROR",
  "sources": [
    "src.xml.18.6"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "empty XPath expression",
      "position": 0,
      "role": "",
      "template": "empty XPath expression"
    }
  ]
}
messages · message.xml-empty-row-path
{
  "limits": "",
  "message_id": "message.xml-empty-row-path",
  "path": "",
  "position": 1,
  "raw": {
    "id": "message.xml-empty-row-path",
    "primary_template": "row path filter must not be empty string",
    "severity_source": "ERROR",
    "sources": [
      "src.xml.18.6"
    ],
    "sqlstate": "10608"
  },
  "severity": "ERROR",
  "sources": [
    "src.xml.18.6"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "row path filter must not be empty string",
      "position": 0,
      "role": "",
      "template": "row path filter must not be empty string"
    }
  ]
}
messages · message.xml-empty-column-path
{
  "limits": "",
  "message_id": "message.xml-empty-column-path",
  "path": "",
  "position": 2,
  "raw": {
    "id": "message.xml-empty-column-path",
    "primary_template": "column path filter must not be empty string",
    "severity_source": "ERROR",
    "sources": [
      "src.xml.18.6"
    ],
    "sqlstate": "10608"
  },
  "severity": "ERROR",
  "sources": [
    "src.xml.18.6"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "column path filter must not be empty string",
      "position": 0,
      "role": "",
      "template": "column path filter must not be empty string"
    }
  ]
}
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#L148"
}
sources · src.xml.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/adt/xml.c",
  "position": 1,
  "sha256": "f1c70b5ee5ee9a20a41d9b2c27bc7a8a50dbd9489ba462a4a678f7f55f14d",
  "source_id": "src.xml.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/xml.c"
}
sources · src.xml2.xpath.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "contrib/xml2/xpath.c",
  "position": 2,
  "sha256": "2eb71a90f3cf2f3d0f4137327600f410dcade58ce1dbde93ea0cf90d81430792",
  "source_id": "src.xml2.xpath.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/xml2/xpath.c"
}
sources · src.xml2.xslt.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "contrib/xml2/xslt_proc.c",
  "position": 3,
  "sha256": "a5a76f59e851175955dfa62477fd4a7d7be3fb69b37e7a7e955ab76c8e01d0ae",
  "source_id": "src.xml2.xslt.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/xml2/xslt_proc.c"
}
sources · src.calls.REL_18_6
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_18_6.jsonl",
  "position": 4,
  "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
  "source_id": "src.calls.REL_18_6",
  "tag": "",
  "url": ""
}

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · english-manuals:a19d1d76bbe5ce7a766222392732be79376f1b66de64aa17fbbf62821d367cf2

Text language: en · english-manuals:a19d1d76bbe5ce7a766222392732be79376f1b66de64aa17fbbf62821d367cf2