Hi all,
Looking for some advice (or a reality check) on how to cleanly recover from a PostgreSQL upgrade that I let pacman do for me.
-
System: ManjaroLinux 26.0.0 Anh-Linh (x86_64)
-
Previously running PostgreSQL 17 with PostGIS 3 on a data dir under
/home/postgresql/17/main -
pacman -Syupulled in a huge upgrade (~900 packages) and upgraded PostgreSQL from 17 to 18, pluspostgis 3.6.0-3 -
I did not run any migration steps before the upgrade (no
pg_upgrade, no dump/restore)
After noticing the version bump, I tried to do an ināplace upgrade using the 17 binaries installed under /opt/pgsql-17 (from postgresql-old-upgrade) and my existing 17 data directory:
bash
pg_upgrade -b /opt/pgsql-17/bin -B /usr/bin -d /home/postgresql/17/main -D /home/postgresql/18/main
pg_upgrade consistently fails while dumping the <DB> database (the one using PostGIS) with this error (from the pg_upgrade_dump_*.log):
pg_dump: error: query failed: ERROR: incompatible library ā/opt/pgsql-17/lib/postgis-3.soā: version mismatch DETAIL: Server is version 17, library is version 18.
Manjaro currently has only this PostGIS package installed:
pacman -Q postgis
postgis 3.6.0-3
pacman -Ql postgis | grep '\.so$'
/usr/lib/postgresql/address_standardizer-3.so
/usr/lib/postgresql/postgis-3.so
/usr/lib/postgresql/postgis_raster-3.so
/usr/lib/postgresql/postgis_topology-3.so
There is no postgis-old-upgrade or postgresql-17-postgis-3 style package available in the repos, and no 17āspecific PostGIS .so on disk. I tried the āobvious but wrongā thing and symlinked the 18 postgis-3.so into /opt/pgsql-17/lib, which just gives the version mismatch above (PostgreSQL 17 correctly refuses to load a library built for 18).
I also tried to bypass pg_upgrade and do a straight pg_dump of the 17 <DB> DB:
bash
/opt/pgsql-17/bin/postgres -D /home/postgresql/17/main -p 55432 & /opt/pgsql-17/bin/pg_dump -h /tmp -p 55432 -U postgres -d <DB> -F c -b -v -f
/home/postgresql/_17.backup
That fails with the same error:
ERROR: incompatible library ā/opt/pgsql-17/lib/postgis-3.soā: version mismatch
DETAIL: Server is version 17, library is version 18.
So at this point:
-
Data directory for 17 is intact and still starts with
/opt/pgsql-17/bin/postgres. -
PostgreSQL 18 and PostGIS 3.6.0-3 are installed in the normal Manjaro locations.
-
There is no 17ācompatible PostGIS library on the system anymore.
-
Both
pg_upgradeandpg_dumpchoke as soon as they touch PostGIS objects, due to the 17 vs 18 ABI mismatch.
What Iām trying to figure out:
-
What is the āManjaroācorrectā way to get a PostGIS build that is compatible with PostgreSQL 17 again?
- Is there an official/archived package (like
postgresql-17-postgis-3or similar) in Manjaro or the Arch archives that I should install, or do I need to build PostGIS from source withPG_CONFIG=/opt/pgsql-17/bin/pg_configand install into/opt/pgsql-17myself?
- Is there an official/archived package (like
-
Is there a recommended way to handle this upgrade path on Manjaro?
-
E.g. should I fully remove 18, reinstall 17 + PostGIS, get clean dumps, and then redo the 17ā18 migration in a more controlled way?
-
Or is there a documented approach for using
postgresql-old-upgrade+ some PostGIS package that Iāve missed?
-
-
If no 17ācompatible PostGIS is available via packages, is ābuild PostGIS from source for 17ā the expected route on Manjaro now?
Iām comfortable compiling from source if needed, but before going down that path Iād like to know if thereās an existing Manjaro/Arch workflow for this scenario, or a package Iāve overlooked.
Thanks for any guidance or pointers to docs/PKGBUILDs that address this kind of 17ā18 + PostGIS upgrade.