Re: temporary views - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: temporary views
Date
Msg-id Pine.LNX.4.30.0110070033320.871-100000@peter.localdomain
Whole thread Raw
In response to Re: temporary views  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: temporary views
List pgsql-sql
Bruce Momjian writes:

> Seems like a TODO item, at least.  What we could do is to create views
> as TEMP if they use temp tables and drop the view as soon as the session
> ends .  You of course would have to recreate the view each time but
> because it is a _temp_ view, it could be done reliably by multiple
> backends at the same time.

SQL requires that no table in a view declaration be a temporary table.

> Added to TODO:
>
>     * Allow views on temporary tables to behave as temporary views

I don't think this is a good idea.  Especially since our temp tables are
allowed to shadow persistent tables, it would not be obvious whether the
view you're creating with any given statement will become persistent or
temporary.

I think an explicit CREATE TEMPORARY VIEW command would be fair and safe,
but until that is done we should probably concentrate on the SQL standard
behaviour.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



pgsql-sql by date:

Previous
From: Masaru Sugawara
Date:
Subject: Re: challenging query
Next
From: "Aasmund Midttun Godal"
Date:
Subject: PlPerl