OK, I tried it as well.

buster# apt-get install postgresql-11-postgis-2.5
# in a minimal chroot, pulls in postgresql-11
# I haven't done anything with postgres, so it should be essentially empty (so only default users, tables, data exist (if any))

buster# apt-get dist-upgrade
# to bullseye with hdf5, gdal, ... patched for libgdal2[08] co-installability.

bullseye# apt-get install postgresql-13-postgis-3
# this cannot be pulled in via dependencies :-(

bullseye# pg_lsclusters
Ver Cluster Port Status Owner    Data directory              Log file
11 main 5432 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log 13 main 5433 online postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log

bullseye# dpkg -l | grep postgis
ii postgresql-11-postgis-2.5 2.5.1+dfsg-1 amd64 Geographic objects support for PostgreSQL 11 ii postgresql-13-postgis-3 3.1.1+dfsg-1 amd64 Geographic objects support for PostgreSQL 13 ii postgresql-13-postgis-3-scripts 3.1.1+dfsg-1 all Geographic objects support for PostgreSQL 13 -- SQL scripts

So packaging wise this looks good. But I have no idea about the postgresql side: * how do I get some tables using the postgis extension into the database to start with? Is there a package in buster that "does that for me" by just installing it (postgis with --install-recommends pulls in postgresql-postgis, but does not populate a database)?
* how do I "verify" that? (SELECT foo FROM bar ...)
* how do I correctly migrate the database (with postgis stuff) from 11 to 13
* how do I verify that it worked ?

There should be a real package postgresql-postgis, not a virtual one. That would make upgrades easier if a package depends on postgresql-postgis to get the new version installed. With the virtual package the dependency is already satisfied by the old package as there is no upgrade path between virtual packages (especially if they are provided by different binary packages). And for obvious reasons, we don't want to add Breaks the old providers. (Installing postgis in buster with --install-recommends enabled does not pull in postgresql-13-postgis-3 during dist-upgrade with --install-recommends enabled.)

Andreas

PS: @Christoph: In piuparts I'm using this receipe to upgrade postgresql clusters after dist-upgrades - is this the correct approach?

                echo "Upgrading PostgreSQL Cluster from ${from} to ${to}"
                pg_dropcluster ${to} main --stop
                pg_upgradecluster -v ${to} ${from} main
                echo "Dropping old PostgreSQL ${from} Cluster"
                pg_dropcluster ${from} main

Reply via email to