Skip site navigation (1) Skip section navigation (2)

Re: Patch for ALTER DATABASE WITH TABLESPACE

From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch for ALTER DATABASE WITH TABLESPACE
Date: 2008-11-04 17:55:17
Message-ID: C0F6602797884925406AB88F@imhotep.credativ.de (view raw or flat)
Thread:
Lists: pgsql-hackers
--On Samstag, Oktober 25, 2008 23:50:47 +0200 Guillaume Lelarge 
<guillaume(at)lelarge(dot)info> wrote:

> Hi,
>
> 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.

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?

I did some minor additions in the docs as well.

-- 
  Thanks

                    Bernd

Attachment: alterdb_tablespace_v2.patch.bz2
Description: application/octet-stream (3.8 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Ron MayerDate: 2008-11-04 17:55:29
Subject: Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle
Previous:From: Tom LaneDate: 2008-11-04 17:23:55
Subject: Re: pre-MED

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group