diff options
author | Michael Paquier <michael@paquier.xyz> | 2021-01-18 14:03:10 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2021-01-18 14:03:10 +0900 |
commit | a3dc926009be833ea505eebd77ce4b72fe708b18 (patch) | |
tree | b72f640647fdb3792d66758c9080f2aca6cf5de0 /src/backend/commands/tablecmds.c | |
parent | 04eb75e783ba49ca2e0e75088d6590b64be8ed4d (diff) | |
download | postgresql-a3dc926009be833ea505eebd77ce4b72fe708b18.tar.gz postgresql-a3dc926009be833ea505eebd77ce4b72fe708b18.zip |
Refactor option handling of CLUSTER, REINDEX and VACUUM
This continues the work done in b5913f6. All the options of those
commands are changed to use hex values rather than enums to reduce the
risk of compatibility bugs when introducing new options. Each option
set is moved into a new structure that can be extended with more
non-boolean options (this was already the case of VACUUM). The code of
REINDEX is restructured so as manual REINDEX commands go through a
single routine from utility.c, like VACUUM, to ease the allocation
handling of option parameters when a command needs to go through
multiple transactions.
This can be used as a base infrastructure for future patches related to
those commands, including reindex filtering and tablespace support.
Per discussion with people mentioned below, as well as Alvaro Herrera
and Peter Eisentraut.
Author: Michael Paquier, Justin Pryzby
Reviewed-by: Alexey Kondratov, Justin Pryzby
Discussion: https://postgr.es/m/X8riynBLwxAD9uKk@paquier.xyz
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index fd55bf4ac7d..8687e9a97c5 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -1854,6 +1854,7 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, { Oid heap_relid; Oid toast_relid; + ReindexParams reindex_params = {0}; /* * This effectively deletes all rows in the table, and may be done @@ -1891,7 +1892,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, /* * Reconstruct the indexes to match, and we're done. */ - reindex_relation(heap_relid, REINDEX_REL_PROCESS_TOAST, 0); + reindex_relation(heap_relid, REINDEX_REL_PROCESS_TOAST, + &reindex_params); } pgstat_count_truncate(rel); |