Re: How about a proper TEMPORARY TABLESPACE? - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: How about a proper TEMPORARY TABLESPACE?
Date
Msg-id 20140618162829.GD16098@tamriel.snowman.net
Whole thread Raw
In response to Re: How about a proper TEMPORARY TABLESPACE?  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Responses Re: How about a proper TEMPORARY TABLESPACE?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
* Fabrízio de Royes Mello (fabriziomello@gmail.com) wrote:
> On Wed, Jun 18, 2014 at 9:00 AM, Stephen Frost <sfrost@snowman.net> wrote:
> > Not sure about that specific syntax (don't we have SET options now?) but
> > I do like the general idea.
>
> Maybe something like that:
>
> CREATE TABLESPACE spcname LOCATION '/foo/bar' WITH (only_temp_relations =
> true);

Yeah, that's more along the lines of what I was thinking.

> Have in mind you must take care if you use ALTER TABLESPACE spcname SET
> (...) to guarantee that exists only temp objects stored in the target
> tablespace, and if exists a regular object you must throw an exception.
>
> Makes sense?

Yes.  I'd definitely like to see an ALTER TABLESPACE option, with an
ERROR that lists out all of the non-temporary objects which are found
(and lists any other databases which have objects in those
tablespaces..).  That would allow administrators who have existing
notionally temporary-only tablespaces to go clean things up to make them
actually temporary-only.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Atomics hardware support table & supported architectures
Next
From: Robert Haas
Date:
Subject: Re: Set new system identifier using pg_resetxlog