Re: Missing [NO] INDENT flag in XMLSerialize backward parsing
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Jim Jones <jim.jones@uni-muenster.de>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Pavel Stehule <pavel.stehule@gmail.com>
Date: 2025-02-21T06:31:01Z
Lists: pgsql-hackers
On Thu, Feb 20, 2025 at 02:27:42PM +0100, Jim Jones wrote:
> This patch adds the missing [NO] INDENT flag to XMLSerialize backward
> parsing.
if (xexpr->op == IS_XMLSERIALIZE)
+ {
appendStringInfo(buf, " AS %s",
format_type_with_typemod(xexpr->type,
xexpr->typmod));
+ if (xexpr->indent)
+ appendStringInfoString(buf, " INDENT");
+ else
+ appendStringInfoString(buf, " NO INDENT");
+ }
Good catch, we are forgetting this option in ruleutils.c. Will fix
down to v16 where this option has been introduced as you are
proposing, with NO INDENT showing up in the default case. The three
expected outputs look OK as written..
--
Michael
Commits
-
Fix cross-version upgrades with XMLSERIALIZE(NO INDENT)
- 514d47dfb69c 16.9 landed
- 310907aaf010 17.5 landed
- 665cafe8a4bd 18.0 landed
-
Add missing deparsing of [NO] IDENT to XMLSERIALIZE()
- 0af3ae468180 16.9 landed
- 2e0f93d7cb09 17.5 landed
- 984410b92326 18.0 landed