summaryrefslogtreecommitdiffstats
path: root/src/bin/pg_upgrade
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:16:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:16:24 +0000
commit2a0f262beff32ba86bcb58f3273214e5d0517c09 (patch)
tree24c0ad10dab36bbd5c22743d3c88c4e0ccd5bc65 /src/bin/pg_upgrade
parentReleasing progress-linux version 16.2-2~progress7.99u1. (diff)
downloadpostgresql-16-2a0f262beff32ba86bcb58f3273214e5d0517c09.tar.xz
postgresql-16-2a0f262beff32ba86bcb58f3273214e5d0517c09.zip
Merging upstream version 16.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/bin/pg_upgrade')
-rw-r--r--src/bin/pg_upgrade/t/002_pg_upgrade.pl41
1 files changed, 27 insertions, 14 deletions
diff --git a/src/bin/pg_upgrade/t/002_pg_upgrade.pl b/src/bin/pg_upgrade/t/002_pg_upgrade.pl
index e5f57e5..d1b44ad 100644
--- a/src/bin/pg_upgrade/t/002_pg_upgrade.pl
+++ b/src/bin/pg_upgrade/t/002_pg_upgrade.pl
@@ -318,7 +318,8 @@ if (defined($ENV{oldinstall}))
}
# Create an invalid database, will be deleted below
-$oldnode->safe_psql('postgres', qq(
+$oldnode->safe_psql(
+ 'postgres', qq(
CREATE DATABASE regression_invalid;
UPDATE pg_database SET datconnlimit = -2 WHERE datname = 'regression_invalid';
));
@@ -352,19 +353,31 @@ ok(-d $newnode->data_dir . "/pg_upgrade_output.d",
rmtree($newnode->data_dir . "/pg_upgrade_output.d");
# Check that pg_upgrade aborts when encountering an invalid database
-command_checks_all(
- [
- 'pg_upgrade', '--no-sync', '-d', $oldnode->data_dir,
- '-D', $newnode->data_dir, '-b', $oldbindir,
- '-B', $newbindir, '-s', $newnode->host,
- '-p', $oldnode->port, '-P', $newnode->port,
- $mode, '--check',
- ],
- 1,
- [qr/invalid/], # pg_upgrade prints errors on stdout :(
- [qr//],
- 'invalid database causes failure');
-rmtree($newnode->data_dir . "/pg_upgrade_output.d");
+# (However, versions that were out of support by commit c66a7d75e652 don't
+# know how to do this, so skip this test there.)
+SKIP:
+{
+ skip "database invalidation not implemented", 1
+ if $oldnode->pg_version < 11;
+
+ command_checks_all(
+ [
+ 'pg_upgrade', '--no-sync',
+ '-d', $oldnode->data_dir,
+ '-D', $newnode->data_dir,
+ '-b', $oldbindir,
+ '-B', $newbindir,
+ '-s', $newnode->host,
+ '-p', $oldnode->port,
+ '-P', $newnode->port,
+ $mode, '--check',
+ ],
+ 1,
+ [qr/invalid/], # pg_upgrade prints errors on stdout :(
+ [qr/^$/],
+ 'invalid database causes failure');
+ rmtree($newnode->data_dir . "/pg_upgrade_output.d");
+}
# And drop it, so we can continue
$oldnode->start;