[postgis-devel] Debian packaging and upgrade

Christoph Berg myon at debian.org
Fri Apr 5 03:15:36 PDT 2019


> > But now that I think about it, your problem was really
> > that of lacking the postgis library for the _old_ PostgreSQL.
> >
> > I really think this is a Debian packaging bug as that library
> > ( /usr/lib/postgresql/9.4/lib/postgis-2.1.4.so ) was removed
> > as part of upgrading PostGIS, but really needs to exist
> > independently instead, because PostGIS .so file is bound to
> > the a specific PostgreSQL version, so it should be packaged
> > separately (postgresql-9.4-postgis-2.1) and not removed upon
> > upgrading postgis or postgresql.
> 
> I agree it should not be removed. In fact, it is already packaged
> separately:
> https://packages.debian.org/jessie/i386/postgresql-9.4-postgis-2.1/filelist

I just did a jessie->stretch upgrade, and postgresql-9.4-postgis-2.1
is indeed removed. Generally, I think we needed a few iterations to
get everything right in the co-installability of different
pgNN-postgisYY packages, and I'm not surprised that YY < 2.3 has bugs.

In this case, the problem is elsewhere, though. I haven't traced the
full dependency chain down, but I think the root of the issue is that
postgresql-9.4-postgis-2.1 transitively depends on libsigc++-2.0-0c2a
in jessie, but in stretch, that package is being replaced by
libsigc++-2.0-0v5, and they two are not co-installable.

Package: libsigc++-2.0-0v5
Source: libsigc++-2.0
Conflicts: libsigc++-2.0-0c2a

So it isn't postgis' fault that it doesn't work for jessie->stretch.
As workaround, do a pg_dumpall before the upgrade, and manually
restore that.


Looking at stretch->buster:

ii  postgis                              2.3.1+dfsg-2                      amd64        Geographic objects support for PostgreSQL
ii  postgresql                           9.6+181+deb9u2                    all          object-relational SQL database (supported version)
ii  postgresql-9.6                       9.6.11-0+deb9u1                   amd64        object-relational SQL database, version 9.6 server
ii  postgresql-9.6-postgis-2.3           2.3.1+dfsg-2                      amd64        Geographic objects support for PostgreSQL 9.6
ii  postgresql-9.6-postgis-2.3-scripts   2.3.1+dfsg-2                      all          Geographic objects support for PostgreSQL 9.6 -- scripts

After "apt dist-upgrade" there is a problem:

postgres=# select postgis_full_version();
FEHLER:  konnte Bibliothek »/usr/lib/postgresql/9.6/lib/rtpostgis-2.3.so« nicht laden: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /lib/x86_64-linux-gnu/libexpat.so.1)

... but restarting the running server fixes it.

postgres=# select postgis_version();
 2.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

pg_upgradecluster works, i.e. using dump/restore. But there is no
actual data in the cluster, just the extension.

pg_upgradecluster -m upgrade (using pg_upgrade) does not work:

$ sudo cat /var/log/postgresql/pg_upgradecluster-9.6-11-postgis.vM6X/loadable_libraries.txt
konnte Bibliothek »$libdir/postgis-2.3« nicht laden: FEHLER:  konnte nicht auf Datei »$libdir/postgis-2.3« zugreifen: Datei oder Verzeichnis nicht gefunden
konnte Bibliothek »$libdir/rtpostgis-2.3« nicht laden: FEHLER:  konnte nicht auf Datei »$libdir/rtpostgis-2.3« zugreifen: Datei oder Verzeichnis nicht gefunden

This isn't fixable by symlinking because the PG version is upgraded at
the same time.

As dump/restore is still the default for pg_upgradecluster, I'd say we
are on the safe side.

Christoph


More information about the postgis-devel mailing list