diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c index 8ddcc5312f7..df218438f03 100644 --- a/src/bin/scripts/reindexdb.c +++ b/src/bin/scripts/reindexdb.c @@ -216,6 +216,9 @@ main(int argc, char *argv[]) if (concurrentCons > 1 && syscatalog) pg_fatal("cannot use multiple jobs to reindex system catalogs"); + if (concurrentCons > 1 && concurrently && indexes.head != NULL) + pg_fatal("cannot use multiple jobs to reindex indexes concurrently"); + if (alldb) { if (dbname) diff --git a/src/bin/scripts/t/090_reindexdb.pl b/src/bin/scripts/t/090_reindexdb.pl index 1bd32d9426c..2f3b7784560 100644 --- a/src/bin/scripts/t/090_reindexdb.pl +++ b/src/bin/scripts/t/090_reindexdb.pl @@ -298,6 +298,16 @@ $node->issues_sql_like( ], qr/statement:\ REINDEX TABLE s1.t1;/, 'parallel reindexdb for schemas does a per-table REINDEX'); +$node->command_fails( + [ + 'reindexdb', + '--jobs' => '2', + '--concurrently', + '--index' => 's1.i1', + '--index' => 's2.i2', + 'postgres', + ], + 'parallel reindexdb for indices concurrently'); $node->command_ok([ 'reindexdb', '--jobs' => '2', '--schema' => 's3' ], 'parallel reindexdb with empty schema'); $node->command_ok(