Skip to content

10608 — invalid_argument_for_xquery

Source-backed reference for PostgreSQL SQLSTATE 10608.

10608

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.

Field Value
SQLSTATE 10608
Condition invalid_argument_for_xquery
Status active
Known present by 18.0
Locked snapshots 18.6, 19beta3
Macros ERRCODE_INVALID_ARGUMENT_FOR_XQUERY
Aliases

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.

22023, 0A000

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.