Support [NO] INDENT option in XMLSERIALIZE().
Tom Lane <tgl@sss.pgh.pa.us>
Support [NO] INDENT option in XMLSERIALIZE(). This adds the ability to pretty-print XML documents ... according to libxml's somewhat idiosyncratic notions of what's pretty, anyway. One notable divergence from a strict reading of the spec is that libxml is willing to collapse empty nodes "<node></node>" to just "<node/>", whereas SQL and the underlying XML spec say that this option should only result in whitespace tweaks. Nonetheless, it seems close enough to justify using the SQL-standard syntax. Jim Jones, reviewed by Peter Smith and myself Discussion: https://postgr.es/m/2f5df461-dad8-6d7d-4568-08e10608a69b@uni-muenster.de
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/datatype.sgml | modified | +8 −1 |
| src/backend/catalog/sql_features.txt | modified | +1 −1 |
| src/backend/executor/execExprInterp.c | modified | +4 −2 |
| src/backend/parser/gram.y | modified | +11 −3 |
| src/backend/parser/parse_expr.c | modified | +1 −0 |
| src/backend/utils/adt/xml.c | modified | +200 −12 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/nodes/parsenodes.h | modified | +1 −0 |
| src/include/nodes/primnodes.h | modified | +3 −1 |
| src/include/parser/kwlist.h | modified | +1 −0 |
| src/include/utils/xml.h | modified | +2 −1 |
| src/test/regress/expected/xml_1.out | modified | +134 −0 |
| src/test/regress/expected/xml_2.out | modified | +186 −0 |
| src/test/regress/expected/xml.out | modified | +186 −0 |
| src/test/regress/sql/xml.sql | modified | +36 −0 |
Documentation touched
Discussion
- [PATCH] Add pretty-printed XML output option 72 messages · 2023-02-02 → 2025-05-22