Re: Temporary Views - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Temporary Views
Date
Msg-id 1029269451.4742.71.camel@rh72.home.ee
Whole thread Raw
In response to Re: Temporary Views  (Hannu Krosing <hannu@tm.ee>)
Responses Re: Temporary Views  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, 2002-08-13 at 21:50, Hannu Krosing wrote:
> On Tue, 2002-08-13 at 20:43, Tom Lane wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > I can go either way on this.
> > 
> > AFAICS "create temp view" would have some small advantage of keeping the
> > view's name out of possibly-public permanent namespaces, so the step of
> > just adding the TEMP option to CREATE VIEW may be worth doing.  The
> > advantage isn't very big but neither is the amount of work.
> 
> Actually I think that having the views on any temp table also temp is
> mandatory, or else these views will be broken in all other backends than
> the one that created them (or expose other backends temp tables and are
> thereby a security risk).

It seems to be a broken view not security risk in 7.2.1

backend 1:

hannu=# create temp table tmp_t1( i int);
CREATE
hannu=# create view tmp_v1 as select * from tmp_t1;
CREATE
hannu=# select * from tmp_v1;i 
---
(0 rows)


backend 2:

hannu=# select * from tmp_v1;
ERROR:  Relation "tmp_t1" does not exist
hannu=# create temp table tmp_t1( i int);
CREATE
hannu=# select * from tmp_v1;
ERROR:  Relation "tmp_t1" with OID 34281 no longer exists

----------------
Hannu



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: FUNC_MAX_ARGS benchmarks
Next
From: Bruce Momjian
Date:
Subject: Re: Open 7.3 items