Re: proposal - get_extension_version function

2023-03-10 Thread Pavel Stehule
Hi st 8. 3. 2023 v 17:58 odesílatel Pavel Stehule napsal: > Hi > > I try to write a safeguard check that ensures the expected extension > version for an extension library. > > Some like > > const char *expected_extversion = "2.5"; > > ... > > extoid = getExtensionOfObject(ProcedureRelationId, >

Re: proposal - get_extension_version function

2023-03-08 Thread Pavel Stehule
st 8. 3. 2023 v 23:43 odesílatel Tom Lane napsal: > Jacob Champion writes: > > What I'm trying to pin down is the project's position on the reverse > > -- binary version X and SQL version X+1 -- because that seems > > generally unmaintainable, and I don't understand why an author would > > pay t

Re: proposal - get_extension_version function

2023-03-08 Thread Tom Lane
Jacob Champion writes: > What I'm trying to pin down is the project's position on the reverse > -- binary version X and SQL version X+1 -- because that seems > generally unmaintainable, and I don't understand why an author would > pay that tax if they could just avoid it by bailing out entirely. (

Re: proposal - get_extension_version function

2023-03-08 Thread Jacob Champion
On Wed, Mar 8, 2023 at 1:47 PM Tom Lane wrote: > Pavel's proposed check would break that too. There's going to be some > interval where the SQL definitions are not in sync with the .so version, > so you really want the .so to support at least two versions' worth of > SQL objects. I think we're i

Re: proposal - get_extension_version function

2023-03-08 Thread Tom Lane
Jacob Champion writes: > On Wed, Mar 8, 2023 at 11:11 AM Pavel Stehule wrote: >> installation from rpm or deb packages > Right, but I thought the safe order for a downgrade was to issue the > SQL downgrade first (thus putting the system back into the > post-upgrade state), and only then replacin

Re: proposal - get_extension_version function

2023-03-08 Thread Jacob Champion
On Wed, Mar 8, 2023 at 11:22 AM Pavel Stehule wrote: > There is agreement - I call this check from functions. I think pg_auto_failover does this too, or at least used to. Timescale does strict compatibility checks as well. It's not entirely comparable to your implementation, though. --Jacob

Re: proposal - get_extension_version function

2023-03-08 Thread Jacob Champion
On Wed, Mar 8, 2023 at 11:11 AM Pavel Stehule wrote: > installation from rpm or deb packages Right, but I thought the safe order for a downgrade was to issue the SQL downgrade first (thus putting the system back into the post-upgrade state), and only then replacing the packages with prior version

Re: proposal - get_extension_version function

2023-03-08 Thread Jacob Champion
On Wed, Mar 8, 2023 at 11:18 AM Tom Lane wrote: > > Jacob Champion writes: > > On Wed, Mar 8, 2023 at 10:49 AM Tom Lane 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

Re: proposal - get_extension_version function

2023-03-08 Thread Pavel Stehule
st 8. 3. 2023 v 20:17 odesílatel Tom Lane napsal: > Jacob Champion writes: > > On Wed, Mar 8, 2023 at 10:49 AM Tom Lane 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 > >> malfunction

Re: proposal - get_extension_version function

2023-03-08 Thread Pavel Stehule
st 8. 3. 2023 v 19:49 odesílatel Tom Lane napsal: > Pavel Stehule 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 exte

Re: proposal - get_extension_version function

2023-03-08 Thread Tom Lane
Jacob Champion writes: > On Wed, Mar 8, 2023 at 10:49 AM Tom Lane 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

Re: proposal - get_extension_version function

2023-03-08 Thread Pavel Stehule
st 8. 3. 2023 v 20:04 odesílatel Jacob Champion napsal: > On Wed, Mar 8, 2023 at 10:49 AM Tom Lane 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? > >

Re: proposal - get_extension_version function

2023-03-08 Thread Jacob Champion
On Wed, Mar 8, 2023 at 10:49 AM Tom Lane 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 n

Re: proposal - get_extension_version function

2023-03-08 Thread Tom Lane
Pavel Stehule 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 yo