Re: Missing [NO] INDENT flag in XMLSerialize backward parsing
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Michael Paquier <michael@paquier.xyz>
Cc: Jim Jones <jim.jones@uni-muenster.de>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Pavel Stehule <pavel.stehule@gmail.com>
Date: 2025-02-21T10:46:52Z
Lists: pgsql-hackers
> On Feb 21, 2025, at 4:55 AM, Michael Paquier <michael@paquier.xyz> wrote:
>
> On Fri, Feb 21, 2025 at 04:36:07AM -0500, Andrew Dunstan wrote:
>> The fix has broken cross version upgrade test. Maybe we need to filter out
>> NO INDENT in releases prior to 16 in AdjustUpgrade.pm?s
>
> Yes, I was just looking at that. The regex I am finishing with in
> AdjustUpgrade.pm is something like that, which is enough to discard
> the NO INDENT clause in an XMLSERIALIZE:
> --- src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
> +++ src/test/perl/PostgreSQL/Test/AdjustUpgrade
> @@ -628,6 +628,12 @@ sub adjust_new_dumpfile
> \s+FUNCTION\s2\s\(text,\stext\)\spublic\.part_hashtext_length\(text,bigint\);} {}mxg;
> }
>
> + # pre-v16 dumps do not know about XMLSERIALIZE(NO INDENT).
> + if ($old_version < 16)
> + {
> + $dump =~ s/XMLSERIALIZE\((.*)? NO INDENT\)/XMLSERIALIZE\($1\)/mg;
> + }
>
> This needs to be applied in adjust_new_dumpfile() so as the comparison
> with the old dump will be stable, is that right?
I think so. Looks good to me
Cheers
Andrew
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