Re: proposal - get_extension_version function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: proposal - get_extension_version function
Date
Msg-id 232607.1678303076@sss.pgh.pa.us
Whole thread Raw
In response to Re: proposal - get_extension_version function  (Jacob Champion <jchampion@timescale.com>)
Responses Re: proposal - get_extension_version function  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: proposal - get_extension_version function  (Jacob Champion <jchampion@timescale.com>)
List pgsql-hackers
Jacob Champion <jchampion@timescale.com> writes:
> On Wed, Mar 8, 2023 at 10:49 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> This is a bad idea.  How will you do extension upgrades, if the new .so
>> won't run till you apply the extension upgrade script but the old .so
>> malfunctions as soon as you do?

> Which upgrade paths allow you to have an old .so with a new version
> number? I didn't realize that was an issue.

More usually, it's the other way around: new .so but SQL objects not
upgraded yet.  That's typical in a pg_upgrade to a new major version,
where the new installation may have a newer extension .so than the
old one did.  You can't run ALTER EXTENSION UPGRADE if the new .so
refuses to load with the old SQL objects ... which AFAICS is exactly
what Pavel's sketch would do.

If you have old .so and new SQL objects, it's likely that at least
some of those new objects won't work --- but it's good to not break
any more functionality than you have to.  That's why I suggest
managing the compatibility checks on a per-function level rather
than trying to have an overall version check.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal - get_extension_version function
Next
From: Pavel Stehule
Date:
Subject: Re: proposal - get_extension_version function