select open change scope Open full search

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

FUNCTIONS / XML FUNCTIONS

The function xpath evaluates the XPath 1.0 expression xpath (given as text) against the XML value xml.

Signatures & examples

xpath ( xpath text, xml xml [, nsarray text[]] ) → xml[]
The function xpath evaluates the XPath 1.0 expression xpath (given as text) against the XML value xml. It returns an array of XML values corresponding to the node-set produced by the XPath expression. If the XPath expression returns a scalar value rather than a node-set, a single-element array is returned.
Version history 4
  1. PG 12 → 13changed
  2. PG 9.6 → 10changed
  3. PG 9.1 → 9.2changed
  4. PG 9.0 → 9.1changed

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