diff options
Diffstat (limited to 'src/bin/scripts/t/011_clusterdb_all.pl')
-rw-r--r-- | src/bin/scripts/t/011_clusterdb_all.pl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bin/scripts/t/011_clusterdb_all.pl b/src/bin/scripts/t/011_clusterdb_all.pl index eb904c08c70..35f0b18f50f 100644 --- a/src/bin/scripts/t/011_clusterdb_all.pl +++ b/src/bin/scripts/t/011_clusterdb_all.pl @@ -21,4 +21,18 @@ $node->issues_sql_like( qr/statement: CLUSTER.*statement: CLUSTER/s, 'cluster all databases'); +$node->safe_psql( + 'postgres', q( + CREATE DATABASE regression_invalid; + UPDATE pg_database SET datconnlimit = -2 WHERE datname = 'regression_invalid'; +)); +$node->command_ok([ 'clusterdb', '-a' ], + 'invalid database not targeted by clusterdb -a'); + +# Doesn't quite belong here, but don't want to waste time by creating an +# invalid database in 010_clusterdb.pl as well. +$node->command_fails_like([ 'clusterdb', '-d', 'regression_invalid'], + qr/FATAL: cannot connect to invalid database "regression_invalid"/, + 'clusterdb cannot target invalid database'); + done_testing(); |