Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Alexey Kondratov <a.kondratov@postgrespro.ru>, Alvaro Herrera <alvherre@2ndquadrant.com>, Masahiko Sawada <masahiko.sawada@2ndquadrant.com>, Steve Singer <steve@ssinger.info>, pgsql-hackers@lists.postgresql.org, Robert Haas <robertmhaas@gmail.com>, Alexander Korotkov <a.korotkov@postgrespro.ru>, Masahiko Sawada <sawada.mshk@gmail.com>, Jose Luis Tallon <jltallon@adv-solutions.net>
Date: 2020-12-04T05:37:12Z
Lists: pgsql-hackers
On Thu, Dec 03, 2020 at 08:46:09PM +0100, Peter Eisentraut wrote: > There are a couple of more places like this, including the existing > ClusterOption that this patched moved around, but we should be removing > those. > > My reasoning is that if you look at an enum value of this type, either say > in a switch statement or a debugger, the enum value might not be any of the > defined symbols. So that way you lose all the type checking that an enum > might give you. VacuumOption does that since 6776142, and ClusterOption since 9ebe057, so switching ReindexOption to just match the two others still looks like the most consistent move. Please note that there is more than that, like ScanOptions, relopt_kind, RVROption, InstrumentOption, TableLikeOption. I would not mind changing that, though I am not sure that this improves readability. And if we'd do it, it may make sense to extend that even more to the places where it would apply like the places mentioned one paragraph above. -- Michael
Commits
-
Add TABLESPACE option to REINDEX
- c5b286047cd6 14.0 landed
-
Refactor code in tablecmds.c to check and process tablespace moves
- 4c9c359d38ff 14.0 landed
-
Refactor option handling of CLUSTER, REINDEX and VACUUM
- a3dc926009be 14.0 landed
-
pg_dump: Don't use enums for defining bit mask values
- d2a2808eb444 14.0 landed
-
Refactor CLUSTER and REINDEX grammar to use DefElem for option lists
- b5913f612079 14.0 landed
-
Refactor parsing rules for option lists of EXPLAIN, VACUUM and ANALYZE
- 873ea9ee692e 14.0 landed
-
Improve tab completion of REINDEX in psql
- 1f75b454134c 14.0 landed
-
Fix possible crash during FATAL exit from reindexing.
- d12bdba77b0f 13.0 cited