Thread: Re: [PATCHES] Tablespace patch review

Re: [PATCHES] Tablespace patch review

From
Tom Lane
Date:
[ switching to pghackers for wider comment ]

Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> By the way, I think that we should deny users the ability to create 
> tablespaces that begin with pg_.  Also, the existing ones should be 
> pg_global and pg_default.  That way, we have room to move if ever we 
> decide we want more system tablespaces.  It also makes it easier to dump 
> non-system tablespaces.

Seems like a reasonable suggestion to me.  Any objections?

BTW, another argument for this is that "default" is a reserved word.
I'd already noticed in testing that CREATE TABLE ... TABLESPACE default
doesn't work unless you double-quote "default".  Calling it pg_default
would avoid that annoyance.
        regards, tom lane


Re: Tablespace patch review

From
Andreas Pflug
Date:
Tom Lane wrote:

>[ switching to pghackers for wider comment ]
>
>Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
>  
>
>>By the way, I think that we should deny users the ability to create 
>>tablespaces that begin with pg_.  Also, the existing ones should be 
>>pg_global and pg_default.  That way, we have room to move if ever we 
>>decide we want more system tablespaces.  It also makes it easier to dump 
>>non-system tablespaces.
>>    
>>
>
>Seems like a reasonable suggestion to me.  Any objections?
>
>BTW, another argument for this is that "default" is a reserved word.
>I'd already noticed in testing that CREATE TABLE ... TABLESPACE default
>doesn't work unless you double-quote "default".  Calling it pg_default
>would avoid that annoyance.
>  
>

CREATE .... TABLESPACE DEFAULT with default as keyword seems reasonable 
too, with default -> pg_default.

I could think of cases where temporary schemas should go to a different 
tablespace, but AFAICS since these are created implicitely there's no 
way to redirect them. Maybe an additional attribute in pg_database for a 
default temp tablespace is desirable?

Regards,
Andreas





Re: Tablespace patch review

From
Tom Lane
Date:
Andreas Pflug <pgadmin@pse-consulting.de> writes:
> I could think of cases where temporary schemas should go to a different 
> tablespace, but AFAICS since these are created implicitely there's no 
> way to redirect them. Maybe an additional attribute in pg_database for a 
> default temp tablespace is desirable?

By default, temp tables will live in the database's default tablespace,
which is not necessarily the pg_default tablespace.  (Hmm, there's
another good reason for renaming it ... if I'd said "default" tablespace
I'd have had to go out of my way to make it clear what I meant.)  This
arguably is sufficient control.  In any case, I'd prefer not to add a
knob to relocate temp stuff until there's proven need for it.  We can
always add features later, but inventing stuff because somebody might
need it is a recipe for overdesign.  (Remember that you can always
redirect a specific temp table to a specific tablespace when you
create it.)

The other thing I think people might possibly want to move around is
pg_largeobject.  If Gavin finishes ALTER TABLE SET TABLESPACE (or
whatever we call it), that should provide a sufficient answer there.
        regards, tom lane


Re: [PATCHES] Tablespace patch review

From
Gavin Sherry
Date:
On Sat, 19 Jun 2004, Tom Lane wrote:

> [ switching to pghackers for wider comment ]
>
> Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> > By the way, I think that we should deny users the ability to create
> > tablespaces that begin with pg_.  Also, the existing ones should be
> > pg_global and pg_default.  That way, we have room to move if ever we
> > decide we want more system tablespaces.  It also makes it easier to dump
> > non-system tablespaces.
>
> Seems like a reasonable suggestion to me.  Any objections?
>
> BTW, another argument for this is that "default" is a reserved word.
> I'd already noticed in testing that CREATE TABLE ... TABLESPACE default
> doesn't work unless you double-quote "default".  Calling it pg_default
> would avoid that annoyance.

Great idea. I recognised that default was reserved and was using "default"
in testing. I meant to raise this for discussion when I submitted the
patch. pg_default/pg_global are great.

Gavin