↑↓ 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.

Reading PG 18current·documented in 17 of 27 versions, 9.1 to 20

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. 12 → 13 changed
  2. 11 → 12 changed
  3. 9.6 → 10 changed
  4. 9.0 → 9.1 added

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