Skip to content

Commit bac5598

Browse files
committed
Handle new --restrict-key requirement for dump testing
This will break dumps from binaries less than v13, but we're not testing those - and this will still work for source databases less than v13. Patch from Tom Lane.
1 parent b99f853 commit bac5598

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

PGBuild/Modules/TestUpgradeXversion.pm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,18 +473,19 @@ sub test_upgrade ## no critic (Subroutines::ProhibitManyArgs)
473473
}
474474

475475
# perform a dump from the old database for comparison purposes.
476-
my $extra_digits = "";
476+
# $dump_opts contains dump switches to use for both old and new databases.
477+
my $dump_opts = ' --restrict-key=test';
477478

478479
if ( $oversion ne 'HEAD'
479480
&& $oversion le 'REL_11_STABLE'
480481
&& ($this_branch eq 'HEAD' || $this_branch gt 'REL_11_STABLE'))
481482
{
482-
$extra_digits = ' --extra-float-digits=0';
483+
$dump_opts .= ' --extra-float-digits=0';
483484
}
484485

485486
# use the NEW pg_dumpall so we're comparing apples with apples.
486487
setinstenv($self, "$installdir", $save_env);
487-
system( qq{"$installdir/bin/pg_dumpall" $extra_digits -p $sport -f }
488+
system( qq{"$installdir/bin/pg_dumpall" $dump_opts -p $sport -f }
488489
. qq{"$upgrade_loc/origin-$oversion.sql" }
489490
. qq{> "$upgrade_loc/$oversion-dump1.log" 2>&1});
490491
return if $?;
@@ -588,7 +589,7 @@ sub test_upgrade ## no critic (Subroutines::ProhibitManyArgs)
588589
return if $?;
589590
}
590591

591-
system( "pg_dumpall $extra_digits -f "
592+
system( "pg_dumpall $dump_opts -f "
592593
. qq{"$upgrade_loc/converted-$oversion-to-$this_branch.sql" }
593594
. qq{> "$upgrade_loc/converted-$oversion-$this_branch.log" 2>&1});
594595
return if $?;

0 commit comments

Comments
 (0)