Re: [PATCH] Add pretty-printed XML output option
Jim Jones <jim.jones@uni-muenster.de>
From: Jim Jones <jim.jones@uni-muenster.de>
To: Nikolay Samokhvalov <samokhvalov@gmail.com>,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-02-16T07:08:16Z
Lists: pgsql-hackers
On 16.02.23 05:38, Nikolay Samokhvalov wrote: > On Thu, Feb 9, 2023 at 2:31 AM Peter Eisentraut > <peter.eisentraut@enterprisedb.com> wrote: > > I suggest we call it "xmlformat", which is an established term for > this. > > > Some very-very old, rusted memory told me that there was something in > standard – and indeed, it seems it described an optional Feature X069, > “XMLSerialize: INDENT” for XMLSERIALIZE. So probably pretty-printing > should go there, to XMLSERIALIZE, to follow the standard? > > Oracle also has an option for it in XMLSERIALIZE, although in a > slightly different form, with ability to specify the number of spaces > for indentation > https://docs.oracle.com/database/121/SQLRF/functions268.htm#SQLRF06231. Hi Nikolay, My first thought was to call it xmlpretty, to make it consistent with the jsonb equivalent "jsonb_pretty". But yes, you make a good observation .. xmlserialize seems to be a much better candidate. I would be willing to refactor my patch if we agree on xmlserialize. Thanks for the suggestion! Jim
Commits
-
Fix memory leak in XMLSERIALIZE(... INDENT).
- f24605e2dc16 18.0 landed
- ee58de10084b 16.10 landed
- 20bae0690322 17.6 landed
-
doc: Move documentation of md5_password_warnings to a better place
- f3622b64762b 18.0 cited
-
Support [NO] INDENT option in XMLSERIALIZE().
- 483bdb2afec9 16.0 landed
-
Add an expected-file to match behavior of latest libxml2.
- 085423e3e326 9.6.0 cited