RE: [PATCH] Support % wildcard in extension upgrade filenames

From: "Regina Obe" <lr(at)pcorp(dot)us>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'Regina Obe'" <r(at)pcorp(dot)us>
Cc: <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "'Sandro Santilli'" <strk(at)kbt(dot)io>
Subject: RE: [PATCH] Support % wildcard in extension upgrade filenames
Date: 2023-01-10 03:03:11
Message-ID: 005301d924a0$13573570$3a05a050$@pcorp.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I continue to think that this is a fundamentally bad idea. It creates all
sorts of
> uncertainties about what is a valid update path and what is not.
Restrictions
> like
>
> + Such wildcard update
> + scripts will only be used when no explicit path is found from
> + old to target version.
>
> are just band-aids to try to cover up the worst problems.
>
> Have you considered the idea of instead inventing a "\include" facility
for
> extension scripts? Then, if you want to use one-monster-script to handle
> different upgrade cases, you still need one script file for each supported
> upgrade step, but those can be one-liners including the common script
file.
> Plus, such a facility could be of use to people who want intermediate
> factorization solutions (that is, some sharing of code without buying all
the
> way into one-monster-script).
>
> regards, tom lane

The problem with an include is that it does nothing for us. We still need to
ship a ton of script files. We've already dealt with the file size issue.

So our PostGIS 3.4.0+ (not yet released) already kind of simulates include
using blank script files that have nothing in them but forces the extension
machinery to upgrade the version to ANY to get to the required installed
version 3.4.0+

So for example postgis--3.3.0--ANY.sql

Would contain this:
-- Just tag extension postgis version as "ANY"
-- Installed by postgis 3.4.0dev
-- Built on ...

And the file has the upgrade steps:
postgis--ANY--3.4.0dev.sql

So that when you are on 3.3.0 and want to upgrade to 3.4.0dev ( it takes
3.3.0 -> ANY -> 3.4.0dev)

The other option I had proposed was getting rid of the micro version, but I
got shot down on that argument -- with PostGIS PSC complaining about people
not being able to upgrade a micro if per chance we have some security patch
released in a micro.

https://lists.osgeo.org/pipermail/postgis-devel/2022-June/029673.html

https://lists.osgeo.org/pipermail/postgis-devel/2022-July/029713.html

Thanks,
Regina

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2023-01-10 03:07:09 Re: Allow DISTINCT to use Incremental Sort
Previous Message Jonathan S. Katz 2023-01-10 02:43:15 Re: Handle infinite recursion in logical replication setup