Re: Are views created 'on the fly'

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: Are views created 'on the fly'
Дата
Msg-id 20090705060018.GA5645@tux
обсуждение исходный текст
Ответ на Are views created 'on the fly'  (richard terry <rterry@pacific.net.au>)
Ответы Re: Are views created 'on the fly'  (richard terry <rterry@pacific.net.au>)
Список pgsql-novice
richard terry <rterry@pacific.net.au> wrote:

> I had an occasion to generate a unique key on a complex view and noticed that
> every time I opened the view in pgAdmin, that the start key changes, does
> that mean that every time one references a view it is created 'on the fly',
> before you query it for data?

A VIEW is nothing else than a stored query. Every time you query the
VIEW, your query is replaced by the definition of the view.

You need a unique key on that view? Well, you can use PG 8.4 and its
build-in row_number(() - function.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: richard terry
Дата:
Сообщение: Are views created 'on the fly'
Следующее
От: richard terry
Дата:
Сообщение: Re: Are views created 'on the fly'