select open change scope Open full search

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

SQLSTATE / CLASS 10 · XQUERY ERROR

invalid_argument_for_xquery

SQLSTATE
10608
Condition name
invalid_argument_for_xquery
Class
XQuery Error
Source macro
ERRCODE_INVALID_ARGUMENT_FOR_XQUERY
Evidence
Source path confirmed
Analysis & operational context

English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗

<h1>10608</h1>

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

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

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

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

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

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.

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.

Source evidence

Evidence belongs to the frozen source and runtime versions listed here. It is not a runtime verification of the selected manual version.

10608 is invalid_argument_for_xquery in SQLSTATE Class 10.

Method: Read the fixed errcodes definition row, severity, and macro.

src.errcodes.18.6

The fixed PostgreSQL 18.6 source contains the report path and message context described on the page.

Method: Read the complete source context around the resolved report group.

Limits: This is source confirmation, not a runtime observation in this batch.

src.xml.18.6 src.xml2.xpath.18.6 src.xml2.xslt.18.6

The locked release definitions establish catalogue presence from the known 18.0 boundary; they do not establish a precise introducing release or runtime use.

Method: Compare canonical release-definition facts with the available history boundary.

Limits: Definition presence is not an emitting-path observation.

src.errcodes.18.6

Message templates

ERROR · message.xml-empty-xpath

Primary

empty XPath expression
ERROR · message.xml-empty-row-path

Primary

row path filter must not be empty string
ERROR · message.xml-empty-column-path

Primary

column path filter must not be empty string

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
  1. PG 17 → 18added

Definition snapshot: english-manuals:fd07418b1bce684b670d8909f81… · English manual source