Re: Feature request: temporary schemas

From: Pete Hollobon <postgres(at)hollobon(dot)com>
To: cowwoc <cowwoc(at)bbs(dot)darktech(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Feature request: temporary schemas
Date: 2014-09-16 09:22:11
Message-ID: CACojYcH8hT_PCn1uG3rzAQgnFQSYS1NCsEUt4=tGX08kE7c9HQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 14 September 2014 22:01, cowwoc <cowwoc(at)bbs(dot)darktech(dot)org> wrote:

> Hi,
>
> I'd like to propose the ability to create temporary schemas.
>
> Unlike temporary tables, this feature would enable developers to create a
> temporary schema once and execute CREATE TABLE statements without the
> TEMPORARY parameter.
>
>
> I think you can use "pg_temp" for this - it's an alias to the current
session's temporary schema. If you set the current schema with "SET
search_path TO pg_temp", all tables, views, functions and so on will be
created in a temporary schema.

The only downside is that you'd need to reference any function calls with
pg_temp explicitly, as pg_temp is "never searched for function or operator
names" (see
http://www.postgresql.org/docs/current/static/runtime-config-client.html)

I have just replied to your Stack Exchange answer too.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Herouth Maoz 2014-09-16 12:21:42 Re: (Solved) Decreasing performance in table partitioning
Previous Message Abelard Hoffman 2014-09-16 08:43:26 pg_dump does not include database-level user-defined GUC variables?