Re: Missing [NO] INDENT flag in XMLSerialize backward parsing

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: Missing [NO] INDENT flag in XMLSerialize backward parsing
Date: 2025-02-21 09:55:22
Message-ID: Z7hNimpV405ClyWx@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

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.pm
@@ -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?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ilia Evdokimov 2025-02-21 10:04:21 Remove vardata parameters from eqjoinsel_inner
Previous Message Zharkov Roman 2025-02-21 09:44:37 Re: TAP test started using meson, can get a tcp port already used by another test.