select open change scope Open full search

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

FUNCTIONS / XML FUNCTIONS

table_to_xml maps the content of the named table, passed as parameter table.

Signatures & examples

table_to_xml ( table regclass, nulls boolean, tableforest boolean, targetns text ) → xml
table_to_xml maps the content of the named table, passed as parameter table. The regclass type accepts strings identifying tables using the usual notation, including optional schema qualification and double quotes (see Section 8.19 for details). query_to_xml executes the query whose text is passed as parameter query and maps the result set. cursor_to_xml fetches the indicated number of rows from the cursor specified by the parameter cursor. This variant is recommended if large tables have to be mapped, because the result value is built up in memory by each function.
Version history 2
  1. PG 13 → 14changed
  2. PG 12 → 13changed

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