Re: proposal - get_extension_version function

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: proposal - get_extension_version function
Date: 2023-03-08 19:19:15
Message-ID: CAFj8pRBsK+XZxeWgj369aCtW48whMg6hbeTZoYuqB4UvjN9Q7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

st 8. 3. 2023 v 19:49 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:

> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> > I try to write a safeguard check that ensures the expected extension
> > version for an extension library.
>
> 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? You need to make the C code as forgiving
> as possible, not as unforgiving as possible.
>

This method doesn't break updates. It allows any registration, just
doesn't allow execution with unsynced SQL API.

>
> If you have C-level ABI changes you need to make, the usual fix is to
> include some sort of version number in the C name of each individual
> function you've changed, so that calls made with the old or the new SQL
> definition will be routed to the right place. There are multiple
> examples of this in contrib/.
>

In my extensions like plpgsql_check I don't want to promise compatible ABI.
I support PostgreSQL 10 .. 16, and I really don't try to multiply code for
any historic input/output.

>
> regards, tom lane
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2023-03-08 19:20:54 Re: lz4 --rm on Ubuntu 18.04 (Add LZ4 compression to pg_dump)
Previous Message Tom Lane 2023-03-08 19:17:56 Re: proposal - get_extension_version function