select open change scope Open full search

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

FUNCTIONS / XML FUNCTIONS

The function xmlexists evaluates an XPath 1.0 expression (the first argument), with the passed XML value as its context item.

Signatures & examples

XMLEXISTS ( text PASSING [BY {REF|VALUE}] xml [BY {REF|VALUE}] ) → boolean
The function xmlexists evaluates an XPath 1.0 expression (the first argument), with the passed XML value as its context item. The function returns false if the result of that evaluation yields an empty node-set, true if it yields any other value. The function returns null if any argument is null. A nonnull value passed as the context item must be an XML document, not a content fragment or any non-XML value.
Version history 4
  1. PG 12 → 13changed
  2. PG 11 → 12changed
  3. PG 9.6 → 10changed
  4. PG 9.0 → 9.1added

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source