Re: Patch for ALTER DATABASE WITH TABLESPACE

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Bernd Helmle <mailings(at)oopsware(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch for ALTER DATABASE WITH TABLESPACE
Date: 2008-11-04 18:12:13
Message-ID: 4910907D.8090800@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bernd Helmle a écrit :
> --On Samstag, Oktober 25, 2008 23:50:47 +0200 Guillaume Lelarge
> <guillaume(at)lelarge(dot)info> wrote:
>
>> Here is my patch to add the ALTER DATABASE WITH TABLESPACE statement. It
>> is part of the TODO list. It intends to allow the move of all relations
>> of a database in its new default tablespace.
>>
>> Comments welcome.
>
> I had a first look on this and in my opinion the patch looks reasonable.
> I moved the usage of heap_modifytuple() to the new heap_modify_tuple()
> API (see attached new diff) and did other minor cleanups.
>

OK.

> However, i'm not satisfied with the syntax, which is currently ALTER
> DATABASE name TABLESPACE foo. We use all over the place SET TABLESPACE
> (e.g. for tables and indexes) and SET SCHEMA for namespaces even, so
> this looks inconsistent. However, hacking this requires a little bit
> more parser-foo, a quick hack shows reduce conflicts due to
> SetResetClause rule. So what do we want in this case?
>

My first intent was to use SET TABLESPACE. But the other parameter
available in the ALTER DATABASE statement use the WITH syntax. So, to be
coherent with the actual ALTER DATABASE statement, I used the WITH syntax.

I know this is not coherent with ALTER TABLE, but it is with ALTER DATABASE.

Anyway, if many think I need to change this, I'll try it.

> I did some minor additions in the docs as well.
>

Thanks for your review.

--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Blewett 2008-11-04 19:05:35 Re: Enable pl/python to return records based on multiple OUT params
Previous Message Tom Lane 2008-11-04 18:03:44 Re: gram.y => preproc.y