[postgis-devel] Rework extension upgrade paths to reduce proliferation

Sandro Santilli strk at kbt.io
Mon Aug 19 09:55:53 PDT 2019


As of today, on my system, pg_extension_update_paths('postgis')
returns 9120 rows. And this is with just 17 versions of postgis
installed [1]. Despite this crowd... I cannot upgrade PostGIS
because:

  ERROR:  extension "postgis" has no update path from version "3.0.0alpha3dev" to version "3.0.0alpha5dev"

So... I was thinking, since we already cheat with PostgreSQL in
order to do the upgrade-to-same-version (using the "<curr>--next" and
"next--<curr>" upgrade paths), how about dropping the "<curr>" portion
of those upgrade paths and always provide, for each version, the
following upgrade paths:

    <ver>-common
    common-<ver>

By doing that, we should be able to always only install a single pair
of upgrade paths for every release (I'd have 34 instead of 9120 files)
and there would always be an upgrade path between any two version:

   <ver1>--common -->  common--<ver2>

The <ver>--common upgrade path does not even need to contain any
real upgrade as it would only be used to cheat PostgreSQL into
believing we stepped to a new version. The common-<ver> should
contain code to prevent attempts to downgrade or similar.

How do you like this idea ?


[1] select * from (select (pg_available_extension_versions()).*) foo
    where name = 'postgis';

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   https://strk.kbt.io/services.html


More information about the postgis-devel mailing list