pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Tomasz Myrta <jasiek@lamer.pl>
Cc: pgsql-sql@postgresql.org
Subject: Re: temporary views
Date: Sun, 07 Oct 2001 22:53:11 -0400
Message-ID: <26444.1002509591@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.30.0110070033320.871-100000@peter.localdomain>
References: <Pine.LNX.4.30.0110070033320.871-100000@peter.localdomain>

Peter Eisentraut <peter_e@gmx.net> writes:
> Bruce Momjian writes:
>> * 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.

I agree with Peter on this --- CREATE TEMP VIEW seems like a fine idea,
but allowing views to be implicitly made temporary sounds like a good
way to shoot yourself in the foot.  ISTM a plain CREATE VIEW should
always create a permanent object, and therefore should error out if it
refers to any temp tables.

However, there are some interesting implications here for the recurring
issue of how plpgsql functions ought to interact with temp tables.
We've generally thought of the current behavior as a simple shortcoming
of plpgsql's query caching logic, and no doubt it is --- but what
*should* the behavior be?  Can a long-lived function validly refer to
short-lived tables?  If so, what should the semantics be, exactly?

			regards, tom lane



view thread (10+ messages)  latest in thread

Message-ID: <26444.1002509591@sss.pgh.pa.us>
Permalink:  ../26444.1002509591@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26444.1002509591@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter_e@gmx.net, pgman@candle.pha.pa.us, jasiek@lamer.pl
  Subject: Re: temporary views
  In-Reply-To: <26444.1002509591@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox