Re: Missing [NO] INDENT flag in XMLSerialize backward parsing - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Missing [NO] INDENT flag in XMLSerialize backward parsing
Date
Msg-id Z7gdpZ46I4TNfqSH@paquier.xyz
Whole thread Raw
In response to Missing [NO] INDENT flag in XMLSerialize backward parsing  (Jim Jones <jim.jones@uni-muenster.de>)
Responses Re: Missing [NO] INDENT flag in XMLSerialize backward parsing
List 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

Attachment

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Reset the output buffer after sending from WalSndWriteData
Next
From: Amit Langote
Date:
Subject: Re: generic plans and "initial" pruning