Re: Temporary Views

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Temporary Views
Дата
Msg-id 2268.1029280327@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Temporary Views  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Temporary Views
Re: Temporary Views
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.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.

(Come to think of it, it might not be completely silly to do, either.
Suppose you want to use a temp table, but some legacy bit of code
insists on accessing the table using a fully-qualified schema name.
You could create a view foo.bar that references temp table baz, and
thereby bypass the fact that you don't know a schema name for baz.
A bit far-fetched I agree, since if the legacy code is in your client
app you can probably fix it instead; but maybe there are more legitimate
uses.)
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Emmanuel Charpentier
Дата:
Сообщение: Possible enhancement : replace view ?
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: Possible enhancement : replace view ?