From 1b49d56d358a9c2e310d66c0ac87216d9b932b78 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Mon, 11 Mar 2024 13:11:20 -0500 Subject: 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 --- src/bin/scripts/t/011_clusterdb_all.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/bin/scripts/t') 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(); -- cgit v1.2.3