Re: Don't cascade drop to view

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Don't cascade drop to view
Дата
Msg-id 20080117174500.GA21761@svana.org
обсуждение исходный текст
Ответ на Re: Don't cascade drop to view  (Erik Jones <erik@myemma.com>)
Список pgsql-general
On Thu, Jan 17, 2008 at 11:10:25AM -0600, Erik Jones wrote:
> If you dropped tables out from under views, how would you expect them
> to act if someone were to query them?  Inconsistent and unpredictable
> are just two words I'd use to describe a system that allowed that.

I'd expect it to throw an error that the tables are missing. I ran into
this today. All it really requires is that the view definition be
parsed at use time rather than at creation time.

> However, if these are relatively simple views, you may be able to get
> away with re-implementing them as functions that return sets of
> whatever record type your views are.

As you say, functions are compiled at use time, and hence don't suffer
this problem. You can build a view on the function and it should be
transparent...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Вложения

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

Предыдущее
От: Erik Jones
Дата:
Сообщение: Re: Don't cascade drop to view
Следующее
От: Steve Clark
Дата:
Сообщение: pg_dumpall