Re: Temporary Views

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hannu Krosing <hannu(at)tm(dot)ee>, Rod Taylor <rbt(at)zort(dot)ca>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Temporary Views
Date: 2002-08-13 23:16:44
Message-ID: 200208132316.g7DNGjb13579@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Yes, I realize that, but when I create an index on a temp table, I can
> > create it even though someone else tries to do the same in another
> > session. If these views on temp tables go away on session exit, and
> > can't be reliably accessed by other users, they should be in the temp
> > schema and therefore invisible to other users and to prevent name
> > conflicts.
>
> I think we should provide the *facility* for temp views; that doesn't
> equate to feeling that we must have an enforcement mechanism to prevent
> you from using a non-temp view on a temp table. The enforcement
> mechanism would be notably more work to write and would slow down the
> creation of views (at least non-temp ones), in order to achieve what?
> Not much that I can see. Admittedly, it's a bit silly to use a
> non-temp view with a temp table, but I don't think the system needs to
> go out of its way to prevent silliness.

My feeling is that either the view is temporary, fully, or it isn't. I
don't see having it in the public namespace _and_ removing it on session
exit as defensible. I would like to update the TODO list to say:

Place views on temporary tables in temporary namespaces

It may be difficult, but I clearly think it is a bug if we don't do it.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-08-13 23:20:00 Re: Possible enhancement : replace view ?
Previous Message Tom Lane 2002-08-13 23:12:07 Re: Temporary Views