Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Bossart2024-03-11 18:11:20 +0000
committerNathan Bossart2024-03-11 18:11:20 +0000
commit1b49d56d358a9c2e310d66c0ac87216d9b932b78 (patch)
tree1a4e29c748c1f861d235871aba051f6d16977349 /src/bin/scripts/t
parent5fb4cea1b4a28267eeb564f1e57cbdfd39f1eea6 (diff)
clusterdb: Allow specifying tables to process in all databases.
Presently, clusterdb's --table option cannot be used together with --all, i.e., you cannot specify tables to process in all databases. This commit removes this unnecessary restriction. In passing, change the synopsis in the documentation to use "[option...]" instead of "[--verbose | -v]". There are other general-purpose options (e.g., --quiet and --echo), but the synopsis currently only lists --verbose. Reviewed-by: Kyotaro Horiguchi, Dean Rasheed Discussion: https://postgr.es/m/20230628232402.GA1954626%40nathanxps13
Diffstat (limited to 'src/bin/scripts/t')
-rw-r--r--src/bin/scripts/t/011_clusterdb_all.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bin/scripts/t/011_clusterdb_all.pl b/src/bin/scripts/t/011_clusterdb_all.pl
index 04078a5b7e6..3415e1d4f49 100644
--- a/src/bin/scripts/t/011_clusterdb_all.pl
+++ b/src/bin/scripts/t/011_clusterdb_all.pl
@@ -33,4 +33,15 @@ $node->command_fails_like([ 'clusterdb', '-d', 'regression_invalid'],
qr/FATAL: cannot connect to invalid database "regression_invalid"/,
'clusterdb cannot target invalid database');
+$node->safe_psql('postgres',
+ 'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a); CLUSTER test1 USING test1x'
+);
+$node->safe_psql('template1',
+ 'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a); CLUSTER test1 USING test1x'
+);
+$node->issues_sql_like(
+ [ 'clusterdb', '-a', '-t', 'test1' ],
+ qr/statement: CLUSTER public\.test1/s,
+ 'cluster specific table in all databases');
+
done_testing();