> I also tested the same regexp expression in isolation
> and I could not repro the issue. Will try a real dumpfile next.
>

repro'd. I don't want to attach the file here, but I added a cp
to get the dump file somewhere local

+++ b/src/bin/pg_upgrade/t/002_pg_upgrade.pl
@@ -326,10 +326,12 @@ $oldnode->restart;
 my @dump_command = (
        'pg_dumpall', '--no-sync', '-d', $oldnode->connstr('postgres'),
        '-f', $dump1_file);
+
 # --extra-float-digits is needed when upgrading from a version older than 11.
 push(@dump_command, '--extra-float-digits', '0')
   if ($oldnode->pg_version < 12);
 $newnode->command_ok(\@dump_command, 'dump before running pg_upgrade');
+system("cp $dump1_file /tmp/myfile.dmp");

and ran with the following perl script

"""
use strict;
use File::Slurp;

my $dump = read_file( '/tmp/myfile.dmp' );
#my $dump = "filler\n 'version', '180000'::integer,\n filler";
print "$dump\n";
$dump =~ s [(^\s+'version',) '\d+'::integer,$] [$1 '000000'::integer,]mg;

print "$dump\n";
"""

--
Sami


Reply via email to