Re: Temporary Views - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Temporary Views
Date
Msg-id 2105.1029279110@sss.pgh.pa.us
Whole thread Raw
In response to Re: Temporary Views  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Temporary Views  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Does every other user see the view name

If he looks in the schema where the view is created, sure --- it's no
different from any other non-temp table or view.

> ... on his temp table?

Um, are you thinking that a view V created to refer to user 1's temp
table T would refer to some other user's temp table T if accessed by
that other user?  That's not how it works.  The reference is absolute,
ie, by OID.

> Can two
> people create a view on a temp table at the same time?

Not the same name in the same schema, but this has nothing to do with
what the views refer to; that's just a plain old name collision.

CREATE TEMP VIEW would be handy for avoiding name collisions if you want
to use the same temp view name in different clients.  But it'd only hide
the *name* of the view (by putting it in your private temp schema); it
has nothing to do with access semantics.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Temporary Views
Next
From: Bruce Momjian
Date:
Subject: Re: Temporary Views