Re: Temporary Views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(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 22:51:50
Message-ID: 2105.1029279110@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-08-13 22:56:36 Re: Temporary Views
Previous Message Bruce Momjian 2002-08-13 22:43:31 Re: Temporary Views