Re: ALTER TABLESPACE MOVE command tag tweak

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER TABLESPACE MOVE command tag tweak
Date: 2014-06-24 01:06:57
Message-ID: 20140624010657.GY16098@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Alvaro Herrera (alvherre(at)2ndquadrant(dot)com) wrote:
> Stephen Frost wrote:
>
> > Any further thoughts on this? I haven't tried to go implement anything
> > yet but I'm definitely concerned that we may run into a keyword issue
> > with ALTER TABLE, but I don't really want to add 'TABLES' either.
> > Anyone have any other suggestions or ideas?
>
> I thought that the suggestion to use MOVE was the most appropriate.
> However I also concur that re-using MOVE from its current cursor-related
> meaning would be troublesome from several PoVs, so if there's a synonym
> of MOVE that we can use, that'd probably be better. I don't like ALTER
> TABLES myself; and having an ALTER TABLE command that affects several
> tables seems counterintuitive as well.
>
> How about
> RELOCATE ALL [ TABLES | INDEXES | ... ] IN TABLESPACE foo TO bar
> ?

The original call for this change was to have it return the command tag
of ALTER TABLE, wasn't it? Would inventing a new command tag like
RELOCATE actually improve the situation..? Or is the thought that it'd
still be ALTER TABLE?

That it's more-or-less a bulk 'ALTER TABLE' operation is why I had been
trying to think of a way to put it under that command. What if we had a
more general way to reference 'all objects in a tablespace'?
"tablespace.*" or "ALL:TABLESAPCE"? Are there other places which might
benefit from being able to take and operate on all objects in a
tablespace?

Of course, we handle this in 'GRANT' with 'GRANT ON ALL TABLES', so why
not 'ALTER TABLE ON ALL TABLES IN TABLESPACE <blah>'? that does get
pretty darn verbose but is at least a bit more in-line with what we have
done before..

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-06-24 01:12:48 Re: PostgreSQL for VAX on NetBSD/OpenBSD
Previous Message Andrew Dunstan 2014-06-24 00:34:08 Re: [HACKERS] BUG #10728: json_to_recordset with nested json objects NULLs columns