[postgis-devel] Upgrade paths (again)

Sandro Santilli strk at kbt.io
Fri Jul 29 23:13:58 PDT 2022


We're still in need to find a good solution
for the ever-growing number of upgrade path
files we're installing on the system:

  https://trac.osgeo.org/postgis/ticket/5092

The currently proposed solutions are in:

  https://trac.osgeo.org/postgis/wiki/PostGISExtensionPaths

And can be summarized here as:

  SOLUTION1 -- modify system catalog
  SOLUTION2 -- patch PostgreSQL
  SOLUTION3 -- 0-bytes model

Regina found altering system catalogs from
postgis_extension_upgrade() is not always
supported, invalidating SOLUTION1:

  https://trac.osgeo.org/postgis/ticket/5194

Patching PostgreSQL is still a long way ahead of time
so we're left with of SOLUTION3, which is the 0-bytes model.

In this model we'd install 0-byte files going to an unspecified
version (ANY), and a real upgrade script going from an arbitrary
version to the current.

PostGIS would then always install 2 upgrade paths:

    <version>--ANY    ( empty )
    ANY--<version>    ( actual upgrade script )

The above 2 files would ALWAYS allow hitting our single upgrade script
by updating to ANY and then to the target version.

The postgis_extensions_upgrade() script, rather than modifying system
catalogs as it does now, would simply UPDATE TO 'ANY' prior to UPDATE
to the target version (rather than directly touching system catalogs).

The problem of NEEDING to install upgrade paths for ANY POSSIBLE
postgis extension version installed kind of remains unsolved
even if it's more of a packaging issue than a postgis installation
issue. What we could do is provide some administration command
(re-using the existing "postgis" command, for example?) to install
the <version>--ANY upgrade paths for specific arbitrary versions
of PostGIS or for those found to be used in databases of a given
cluster, something like:

  loader/postgis install-upgrade-path-from <version>
  loader/postgis install-upgrade-paths-for <database>

Comments ? Especially from packagers, as the loader/postgis would
then possibly need to be called at upgrade time to figure out what's
needed...

--strk; 

  Libre GIS consultant/developer
  https://strk.kbt.io/services.html


More information about the postgis-devel mailing list