aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/reindexdb.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-07-19 11:45:06 +0900
committerMichael Paquier <michael@paquier.xyz>2022-07-19 11:45:06 +0900
commit2cbc3c17a5c11d13c0ac92fe7557c56408f8f3d0 (patch)
tree835b1a5f656c1bb7ec6439e9ef66532b1f1670e8 /src/bin/scripts/reindexdb.c
parent5fb5b6c4c176d873bd8405ec40f7002daf242a36 (diff)
downloadpostgresql-2cbc3c17a5c11d13c0ac92fe7557c56408f8f3d0.tar.gz
postgresql-2cbc3c17a5c11d13c0ac92fe7557c56408f8f3d0.zip
Rework logic and simplify syntax of REINDEX DATABASE/SYSTEM
Per discussion, this commit includes a couple of changes to these two flavors of REINDEX: * The grammar is changed to make the name of the object optional, hence one can rebuild all the indexes of the wanted area by specifying only "REINDEX DATABASE;" or "REINDEX SYSTEM;". Previously, the object name was mandatory and had to match the name of the database on which the command is issued. * REINDEX DATABASE is changed to ignore catalogs, making this task only possible with REINDEX SYSTEM. This is a historical change, but there was no way to work only on the indexes of a database without touching the catalogs. We have discussed more approaches here, like the addition of an option to skip the catalogs without changing the original behavior, but concluded that what we have here is for the best. This builds on top of the TAP tests introduced in 5fb5b6c, showing the change in behavior for REINDEX SYSTEM. reindexdb is updated so as we do not issue an extra REINDEX SYSTEM when working on a database in the non-concurrent case, something that was confusing when --concurrently got introduced, so this simplifies the code. Author: Simon Riggs Reviewed-by: Ashutosh Bapat, Bernd Helmle, Álvaro Herrera, Cary Huang, Michael Paquier Discussion: https://postgr.es/m/CANbhV-H=NH6Om4-X6cRjDWfH_Mu1usqwkuYVp-hwdB_PSHWRfg@mail.gmail.com
Diffstat (limited to 'src/bin/scripts/reindexdb.c')
-rw-r--r--src/bin/scripts/reindexdb.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c
index f3b03ec3256..0e93a4eeff0 100644
--- a/src/bin/scripts/reindexdb.c
+++ b/src/bin/scripts/reindexdb.c
@@ -360,18 +360,6 @@ reindex_one_database(ConnParams *cparams, ReindexType type,
{
case REINDEX_DATABASE:
- /*
- * Database-wide parallel reindex requires special processing.
- * If multiple jobs were asked, we have to reindex system
- * catalogs first as they cannot be processed in parallel.
- */
- if (concurrently)
- pg_log_warning("cannot reindex system catalogs concurrently, skipping all");
- else
- run_reindex_command(conn, REINDEX_SYSTEM, PQdb(conn), echo,
- verbose, concurrently, false,
- tablespace);
-
/* Build a list of relations from the database */
process_list = get_parallel_object_list(conn, process_type,
user_list, echo);