Re: all views in database broken at once

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: all views in database broken at once
Дата
Msg-id 10008.985481400@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: all views in database broken at once  (Andrew Perrin <aperrin@socrates.berkeley.edu>)
Ответы Re: all views in database broken at once  (Mathijs Brands <mathijs@ilse.nl>)
Re: all views in database broken at once  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-sql
Andrew Perrin <aperrin@socrates.berkeley.edu> writes:
> But I'm intrigued: what is it that causes this? Is it *my*
> recreating the view on which the other views depend,

Yes.  You dropped and recreated the view --- the new version may have
the same name but it's not the same OID, so it isn't the same object.
And the other views refer to it by OID.

The ultimate solution should have two parts, IMHO:

1. Dependency checking so that you *can't* drop a view that is still
referenced.  However this will not be complete --- it's not clear that
we can detect references inside PL functions, for example.

2. An ALTER VIEW command that lets you change a view's defining query,
while keeping the same OID, as long as the names and types of the output
columns don't change.  This would reduce the need to drop and recreate
views.
        regards, tom lane


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

Предыдущее
От: Andrew Perrin
Дата:
Сообщение: Re: all views in database broken at once
Следующее
От: Mathijs Brands
Дата:
Сообщение: Re: all views in database broken at once