Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Alexey Kondratov <a.kondratov@postgrespro.ru>
Cc: Michael Paquier <michael@paquier.xyz>, Masahiko Sawada <masahiko.sawada@2ndquadrant.com>, Steve Singer <steve@ssinger.info>, pgsql-hackers@lists.postgresql.org, Alvaro Herrera <alvherre@2ndquadrant.com>, 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-03-27T04:01:06Z
Lists: pgsql-hackers
> Another issue is this: > > +VACUUM ( FULL [, ...] ) [ TABLESPACE <replaceable class="parameter">new_tablespace</replaceable> ] [ <replaceable class="parameter">table_and_columns</replaceable> [, ...] ] > As you mentioned in your v1 patch, in the other cases, "tablespace > [tablespace]" is added at the end of the command rather than in the middle. I > wasn't able to make that work, maybe because "tablespace" isn't a fully > reserved word (?). I didn't try with "SET TABLESPACE", although I understand > it'd be better without "SET". I think we should use the parenthesized syntax for vacuum - it seems clear in hindsight. Possibly REINDEX should use that, too, instead of adding OptTablespace at the end. I'm not sure. CLUSTER doesn't support parenthesized syntax, but .. maybe it should? Also, perhaps VAC FULL (and CLUSTER, if it grows parenthesized syntax), should support something like this: USING INDEX TABLESPACE name I guess I would prefer just "index tablespace", without "using": |VACUUM(FULL, TABLESPACE ts, INDEX TABLESPACE its) t; |CLUSTER(VERBOSE, TABLESPACE ts, INDEX TABLESPACE its) t; -- Justin
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