[postgis-devel] Upgrade paths (again)

Greg Troxel gdt at lexort.com
Wed Sep 14 05:31:11 PDT 2022


Sandro Santilli <strk at kbt.io> writes:

> On Sun, Aug 14, 2022 at 06:50:13AM -0400, Greg Troxel wrote:
>> Sandro Santilli <strk at kbt.io> writes:
>> 
>> > The package managers I know of have the ability to run a script before
>> > or after doing "things". Don't knot the details but they do things
>> > like setting symlinks or starting interactive configuration sessions.
>> >
>> > They may as well run that script.
>> 
>> Yes, scripts can be run, but I view using that facility as an negative,
>> rather than just producing the right bits at package build time.
>
> There is no "right bits" as those depend on the status of the machine.
> What's "right" depends on what versions users need to upgrade from,
> thus the script (which can only partially determine that, in its
> current state).

I see.  Well, my view is that in packaging we try to push as many things
into "build", and do as little as possible/reasonable at install time.

And, at package installation time, it is quite possible that pgsql is
not running, and the package manager probably doesn't have database
privs.

>> And, at least in pkgsrc, running a de-installation script won't have
>> available files (or any other information) from the new package.
>
> I don't understand this last statement.

What I meant is that upgrading consists of

  - running a before-deinstallation script, usually empty
  - removing the files that the package installs, except config files
    meant to be edited by the user (in /usr/pkg/etc usually)

  - installing the files from the new package
  - running an after-installation script


This is the same as pkg_delete/pkg_add, except that when upgrading foo,
then for things bar that depend on foo, bar's dependencies are repointed
to the new foo, and the removal of foo isn't blocked with a "bar depends
on foo; can't delete foo without -f" message.

So the before-deinstallation script doesn't know about the new package;
it is a component of the old package.  It doesn't know about upgrades,
just that the package is being removed.

I think we're somewhat running into "databases are hard and need a DBA".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20220914/f58975a3/attachment.sig>


More information about the postgis-devel mailing list