Re: Using ALTER TABLESPACE in pg_dump

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Philip Warner <pjw(at)rhyme(dot)com(dot)au>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Using ALTER TABLESPACE in pg_dump
Date: 2004-10-26 03:52:45
Message-ID: 200410260352.i9Q3qjW03085@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> > I think a viable solution is to go with the latter (ie, for CREATE TABLE
> > foo(i int primary key) TABLESPACE ts; the index on i is created in
> > default_tablespace). However, I might be nice to be able to specify the
> > tablespace as part of the primary key clause. I say nice, but not
> > necessary.
>
> We already have that don't we?
>
> create table foo (f1 int,
> primary key (f1) using index tablespace its)
> tablespace tts;
>
> The question is where to put foo_pkey when "using index tablespace"
> isn't there but "tablespace" is.

I think that lacking a tablespace clause in the index section the
behavior of least surprise would be to use the outer tablespace
specification if it exists, and if not use the GUC variable for the
tablespace (basically the tablespace of the table for the index). We
already name the tablespace using our own name if we create it as part
of CREATE TABLE so it seems natural to also use the tablespace of the
table. The idea that a non-specified value defaults to the outer
level's default (tablespace) is a natural behavior people expect.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-10-26 04:00:33 Re: Command-line parsing in pg_ctl is not portable
Previous Message Bruce Momjian 2004-10-26 03:49:25 Re: Using ALTER TABLESPACE in pg_dump