Re: views on temp tables - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: views on temp tables
Date
Msg-id 200203242235.g2OMZFV05074@candle.pha.pa.us
Whole thread Raw
In response to views on temp tables  (Neil Conway <nconway@klamath.dyndns.org>)
List pgsql-hackers
Neil Conway wrote:
> I was browsing through SQL92 and I noticed this, when discussing the
> CREATE VIEW syntax:
> 
> "5) Any <table name> that is specified in the <query expression> shall
> be different from the <table name> of any <temporary table
> declaration>."
> 
> (<query expression> is the defintion of the view. This basically says
> that you're not allowed to create views on temp tables.)
> 
> Currently, PostgreSQL allows this -- when the session ends and the temp
> table is dropped, an subsequent queries on the view fail. Is this the
> optimal behavior?

Clearly not optimal.  TODO has:
* Allow temporary views

My idea would be to make any view temporary that relies on a temp table
--- throw a NOTICE to the user when they create it so they know it is
temporary.  We could allow TEMP on CREATE VIEW but there seems little
reason for that, though we could allow TEMP views on real tables, so I
guess we would need that option too.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: views on temp tables
Next
From: Peter Eisentraut
Date:
Subject: Re: Configuring for 64-bit integer date/time storage?