Re: views on temp tables

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: views on temp tables
Date: 2002-03-24 22:35:15
Message-ID: 200203242235.g2OMZFV05074@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-03-25 02:22:12 Re: Configuring for 64-bit integer date/time storage?
Previous Message Neil Conway 2002-03-24 21:59:32 views on temp tables