Re: Temporary Views

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Rod Taylor <rbt(at)zort(dot)ca>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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 15:31:23
Message-ID: 200208131531.g7DFVNT07945@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rod Taylor wrote:
> On Tue, 2002-08-13 at 11:18, Bruce Momjian wrote:
> > Tom Lane wrote:
> > > Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > > > I'm thinking that temporary views should be pretty trivial to
> > > > implement.
> > >
> > > ... except not so trivial, per the rest of your note.
> > >
> > > Do we actually need any such feature? Views on temp tables already work
> > > correctly in CVS tip: the implicit DROP CASCADE on temp tables at
> > > backend exit makes such views go 'way too.
> >
> > Oh. but RESTRICT is the default. Seems like the view should go away no
> > matter what, and if they mix temp and non-temp tables, is it obvious
> > that the view will disappear if they didn't specify TEMP on view
> > creation.
>
> When the backend exits the code that removes temp tables is CASCADE by
> default and anything depending on it will disappear.

Oh, OK, that is interesting. So that only leaves the issue of not
specifying TEMP in a case of views using mixed temp/non-temp tables. We
don't specify TEMP when creating an index on a temp table, and it is
auto-destroyed. I guess it is OK that we don't specify TEMP on a view
creation using a temp table, except that the view can have a mix of temp
and non-temp while an index is just on one table.

I can go either way on this.

--
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 strange 2002-08-13 15:43:18 Re: [HACKERS] Linux Largefile Support In Postgresql RPMS
Previous Message Andrew Sullivan 2002-08-13 15:31:15 Re: [HACKERS] Linux Largefile Support In Postgresql RPMS