↑↓ select ↵ open ⌫ change scope Open full search

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

Functions / Xml Functions

The xmltable expression produces a table based on an XML value, an XPath filter to extract rows, and a set of column definitions.

Reading PG 18current·documented in 11 of 27 versions, 10 to 20

Signatures & examples

XMLTABLE ( [XMLNAMESPACES ( namespace_uri AS namespace_name [, ...] ), ] row_expression PASSING [BY {REF|VALUE}] document_expression [BY {REF|VALUE}] COLUMNS name { type [PATH column_expression] [DEFAULT default_expression] [NOT NULL | NULL] | FOR ORDINALITY } [, ...] ) → setof record
The xmltable expression produces a table based on an XML value, an XPath filter to extract rows, and a set of column definitions. Although it syntactically resembles a function, it can only appear as a table in a query's FROM clause.
Version history 3
  1. 12 → 13 changed
  2. 11 → 12 changed
  3. 9.6 → 10 added

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