pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix some whitespace issues in XMLSERIALIZE(... INDENT). 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix some whitespace issues in XMLSERIALIZE(... INDENT). @ 2024-09-10 20:20 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2024-09-10 20:20 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix some whitespace issues in XMLSERIALIZE(... INDENT). We must drop whitespace while parsing the input, else libxml2 will include "blank" nodes that interfere with the desired indentation behavior. The end result is that we didn't indent nodes separated by whitespace. Also, it seems that libxml2 may add a trailing newline when working in DOCUMENT mode. This is semantically insignificant, so strip it. This is in the gray area between being a bug fix and a definition change. However, the INDENT option is still pretty new (since v16), so I think we can get away with changing this in stable branches. Hence, back-patch to v16. Jim Jones Discussion: https://postgr.es/m/872865a8-548b-48e1-bfcd-4e38e672c1e4@uni-muenster.de Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/bccca780eef904002512a1a0b5ce617bcb63507b Modified Files -------------- src/backend/utils/adt/xml.c | 27 ++++++++++++++++++++++++--- src/test/regress/expected/xml.out | 33 +++++++++++++++++++++++---------- src/test/regress/expected/xml_1.out | 11 +++++++++++ src/test/regress/expected/xml_2.out | 33 +++++++++++++++++++++++---------- src/test/regress/sql/xml.sql | 3 +++ 5 files changed, 84 insertions(+), 23 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix some whitespace issues in XMLSERIALIZE(... INDENT). @ 2024-09-10 20:20 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2024-09-10 20:20 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix some whitespace issues in XMLSERIALIZE(... INDENT). We must drop whitespace while parsing the input, else libxml2 will include "blank" nodes that interfere with the desired indentation behavior. The end result is that we didn't indent nodes separated by whitespace. Also, it seems that libxml2 may add a trailing newline when working in DOCUMENT mode. This is semantically insignificant, so strip it. This is in the gray area between being a bug fix and a definition change. However, the INDENT option is still pretty new (since v16), so I think we can get away with changing this in stable branches. Hence, back-patch to v16. Jim Jones Discussion: https://postgr.es/m/872865a8-548b-48e1-bfcd-4e38e672c1e4@uni-muenster.de Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/946f150aa180ec61d37d7a41e43765b4c25ca784 Modified Files -------------- src/backend/utils/adt/xml.c | 27 ++++++++++++++++++++++++--- src/test/regress/expected/xml.out | 33 +++++++++++++++++++++++---------- src/test/regress/expected/xml_1.out | 11 +++++++++++ src/test/regress/expected/xml_2.out | 33 +++++++++++++++++++++++---------- src/test/regress/sql/xml.sql | 3 +++ 5 files changed, 84 insertions(+), 23 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix some whitespace issues in XMLSERIALIZE(... INDENT). @ 2024-09-10 20:20 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2024-09-10 20:20 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix some whitespace issues in XMLSERIALIZE(... INDENT). We must drop whitespace while parsing the input, else libxml2 will include "blank" nodes that interfere with the desired indentation behavior. The end result is that we didn't indent nodes separated by whitespace. Also, it seems that libxml2 may add a trailing newline when working in DOCUMENT mode. This is semantically insignificant, so strip it. This is in the gray area between being a bug fix and a definition change. However, the INDENT option is still pretty new (since v16), so I think we can get away with changing this in stable branches. Hence, back-patch to v16. Jim Jones Discussion: https://postgr.es/m/872865a8-548b-48e1-bfcd-4e38e672c1e4@uni-muenster.de Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/06c285018a81ce4364e370d276be796a632115f8 Modified Files -------------- src/backend/utils/adt/xml.c | 27 ++++++++++++++++++++++++--- src/test/regress/expected/xml.out | 33 +++++++++++++++++++++++---------- src/test/regress/expected/xml_1.out | 11 +++++++++++ src/test/regress/expected/xml_2.out | 33 +++++++++++++++++++++++---------- src/test/regress/sql/xml.sql | 3 +++ 5 files changed, 84 insertions(+), 23 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2024-09-10 20:20 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-09-10 20:20 pgsql: Fix some whitespace issues in XMLSERIALIZE(... INDENT). Tom Lane <tgl@sss.pgh.pa.us> 2024-09-10 20:20 pgsql: Fix some whitespace issues in XMLSERIALIZE(... INDENT). Tom Lane <tgl@sss.pgh.pa.us> 2024-09-10 20:20 pgsql: Fix some whitespace issues in XMLSERIALIZE(... INDENT). Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox