[postgis-devel] Separate make target to install extension upgrade scripts ?

Greg Troxel gdt at lexort.com
Thu Jan 26 08:56:21 PST 2023


Sandro Santilli <strk at kbt.io> writes:

>> Do you mean that after the reduced install, with the sources gone, you
>> can as root run "postgis mumble" and have upgrade scripts generated
>> (from files that were installed) and placed into the system?   Or did
>> you mean something else?
>
> That's pretty much what I meant, although I was not thinking to
> install the *list* from "supported old versions", which would still
> only be available at build time. 
>
> In normal cases you don't need/care about being able to install from
> any of the *known* old versions (86 at the time of writing, see
> extensions/upgradeable_versions.mk) so I'd rather not install that
> knowledge, which is bound to get obsoleted anyway by new patch-level
> releases.
>
> What you can do with the `postgis` utility is:
>
>   install-extension-upgrades [--pg_sharedir <dir>] [--extension <name>] [<from>...]
>                 Ensure files required to upgrade PostGIS from
>                 the given version are installed on the system.
>                 The <from> arguments may be either version numbers
>                 or PostgreSQL share directories to scan to find
>                 available ones.
>
> So, say you get a message like "no upgrade path from 3.0.11 to 3.4.0"
> you can do:
>
>   postgis install-extension-upgrades 3.0.11
>
> And move on.

I see.  My real concern -- which you've addressed -- is that after
whatever is installed, the build dir removed, and the contents of the
tarred DESTDIR that install was done to unpacked on some other system,
it can be used to upgrade in a reasonable manner.

>> (As an aside, if so, from  there it seems a small step to an upgrade
>> command that stages the script in /tmp, runs it, and discards the script.)
>
> As a package, if you can tell WHICH older version is going to be
> removed, you could just run:
>
>   postgis install-extension-upgrades $OLDVERSION
>
> after having installed the new version.

Interesting, but for pkgsrc we really can't tell what the old version
was.


More information about the postgis-devel mailing list