Re: Andreas Beckmann > 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)?
sudo -u postgres psql -vON_ERROR_STOP=1 <<EOF create extension postgis; create table test (geom geometry); insert into test values ('POLYGON((1 1,1 2,2 2,2 1,1 1))'); EOF > * how do I "verify" that? (SELECT foo FROM bar ...) select * from test; geom ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 01030000000100000005000000000000000000F03F000000000000F03F000000000000F03F0000000000000040000000000000004000000000000000400000000000000040000000000000F03F000000000000F03F000000000000F03F > * how do I correctly migrate the database (with postgis stuff) from 11 to 13 As said in my mail: pg_dumpall, then dist-upgrade, and load the dump again. Once gdal is fixed, pg_upgradecluster should work, modulo the problem I ran into. (I still have to retry it.) > * how do I verify that it worked ? Do that select again. > There should be a real package postgresql-postgis, not a virtual one. Yes, but in the general case of other PG extension packages which are usually quite small, I'm reluctant to add yet another micro-package just for the dependencies. Though maybe that's the way to go... > 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 Yes. (Though pg_upgradecluster is bad at reporting errors during the upgrade, so you'd have to check if all tables/data arrived manually.) Christoph