Re: [COMMITTERS] pgsql: Add ALTER TABLESPACE ... MOVE command

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Add ALTER TABLESPACE ... MOVE command
Date: 2014-04-03 19:14:32
Message-ID: 20140403191431.GG22921@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Stephen Frost wrote:
> Add ALTER TABLESPACE ... MOVE command
>
> This adds a 'MOVE' sub-command to ALTER TABLESPACE which allows moving sets of
> objects from one tablespace to another. This can be extremely handy and avoids
> a lot of error-prone scripting. ALTER TABLESPACE ... MOVE will only move
> objects the user owns, will notify the user if no objects were found, and can
> be used to move ALL objects or specific types of objects (TABLES, INDEXES, or
> MATERIALIZED VIEWS).

I just noticed that this commit added the new commands under the
"ALTER THING name RENAME TO" production (which were originally for
RenameStmt); since commit d86d51a95 had already added some
AlterTableSpaceOptionsStmt nodes to the possible results, maybe this
wasn't so bad in itself; but still it seems quite unlike the way we
organize our parse productions.

If we don't want to add new productions for these new node types, I
think at least this comment update is warranted:

diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 2867fa2..359bb8c 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -7009,6 +7009,8 @@ opt_force: FORCE { $$ = TRUE; }
/*****************************************************************************
*
* ALTER THING name RENAME TO newname
+ * ALTER TABLESPACE name MOVE blah
+ * ALTER TABLESPACE name SET/RESET blah
*
*****************************************************************************/

Other thoughts?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-04-03 20:57:58 pgsql: Code review for commit d26888bc4d1e539a82f21382b0000fe5bbf889d9.
Previous Message Tom Lane 2014-04-03 18:19:19 pgsql: Fix documentation about joining pg_locks to other views.

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2014-04-03 19:19:50 Re: B-Tree support function number 3 (strxfrm() optimization)
Previous Message Andrew Dunstan 2014-04-03 18:49:54 Re: Useless "Replica Identity: NOTHING" noise from psql \d