Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, Steve Singer <steve(at)ssinger(dot)info>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Jose Luis Tallon <jltallon(at)adv-solutions(dot)net>
Subject: Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly
Date: 2020-03-28 00:11:12
Message-ID: 20200328001112.GX20103@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 26, 2020 at 11:01:06PM -0500, Justin Pryzby wrote:
> > 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.

The attached mostly implements generic parenthesized options to REINDEX(...),
so I'm soliciting opinions: should TABLESPACE be implemented in parenthesized
syntax or non?

> CLUSTER doesn't support parenthesized syntax, but .. maybe it should?

And this ?

--
Justin

Attachment Content-Type Size
v14-0001-Allow-REINDEX-to-change-tablespace.patch text/x-diff 34.0 KB
v14-0002-Allow-CLUSTER-and-VACUUM-FULL-to-change-tablespa.patch text/x-diff 24.8 KB
v14-0003-fixes2.patch text/x-diff 4.2 KB
v14-0004-Parenthesized-syntax-VACUUM-FULL-TABLESPACE.patch text/x-diff 9.7 KB
v14-0005-Change-reindex-to-take-an-option-list.patch text/x-diff 22.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2020-03-28 00:21:10 Re: Make MemoryContextMemAllocated() more precise
Previous Message Tom Lane 2020-03-27 23:57:12 Re: pgbench - refactor init functions with buffers