Re: Fixing busted citext function declarations

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Fixing busted citext function declarations
Date: 2015-05-05 17:17:59
Message-ID: F3585591-E0F8-4E46-A51A-28488B9B8F05@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On May 5, 2015, at 10:07 AM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)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 dependency errors to COMMIT time, so if a function is replaced with a new one that’s compatible with the old, the dependency tree could be updated automatically.

Best,

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-05-05 17:20:24 Re: Fixing busted citext function declarations
Previous Message Alvaro Herrera 2015-05-05 17:07:08 Re: Fixing busted citext function declarations