Re: Fixing busted citext function declarations

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: Fixing busted citext function declarations
Дата
Msg-id F3585591-E0F8-4E46-A51A-28488B9B8F05@justatheory.com
обсуждение исходный текст
Ответ на Re: Fixing busted citext function declarations  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On May 5, 2015, at 10:07 AM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

>> So AFAICS we need to actually drop and recreate
>> the citext regexp_matches() functions in the upgrade script.  That means
>> "ALTER EXTENSION citext UPDATE" will fail if these functions are being
>> used in any views.  That's annoying but I see no way around it.  (We
>> could have the upgrade script do DROP CASCADE, but that seems way too
>> destructive.)
>
> I think we do need to have the upgrade script drop/recreate without
> cascade.  Then, users can "alter extension upgrade", note the
> problematic views (which should be part of the error message), drop
> them, then retry the extension update and re-create their views.  This
> is necessarily a manual procedure -- I don't think we can re-create
> views using the function automatically.  CASCADE seems pretty dangerous.

FWIW, this is a challenge inherent in all extension upgrade scripts. It’d be great if there was a way to defer such
dependencyerrors to COMMIT time, so if a function is replaced with a new one that’s compatible with the old, the
dependencytree could be updated automatically. 

Best,

David


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Fixing busted citext function declarations
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Fixing busted citext function declarations