Bug 240645

Summary: databases/postgis*: Upgrading postgis and postgresql at the same time fails
Product: Ports & Packages Reporter: smars
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Open ---    
Severity: Affects Some People CC: girgen, harrison.grundy, lbartoletti, pgsql, rhurlin
Priority: --- Keywords: needs-qa
Version: LatestFlags: lbartoletti: maintainer-feedback+
Hardware: Any   
OS: Any   

Description smars 2019-09-17 14:07:22 UTC
The line (20190829) in /usr/ports/UPDATING instructing how to convert database to the newest version fails when databases to convert use the postgis extension:

--> /usr/ports/UPDATING
su -l postgres -c "pg_upgrade -b /tmp/pg-upgrade/usr/local/bin/ -d /usr/local/pgsql/data/ -B /us      r/local/bin/ -D /var/db/postgres/data11/ -U pgsql "

It is a version incompatibility problem of databases/postgis* (new version is 2.5, previous version 2.4):

-> /var/log/messages:
"could not access file "$libdir/postgis-2.4": No such file or directory"

I tried:
1. to create a simlink (no effect)
2. to install the previous version of postgis in /tmp/pg-upgrade (to do something similar as what is proposed in UPDATING)
-> /var/log/messages:
ERROR:  incompatible library "/tmp/pg-upgrade/usr/local/lib/postgresql/postgis-2.4.so": version mismatch
Sep 17 21:39:40 <local0.warn> * postgres[5237]: [3-2] DETAIL:  Server is version 9.5, library is version 9.4.

Comment 1 Palle Girgensohn freebsd_committer 2020-02-15 12:09:16 UTC

Sorry for this late answer. From your error message, it seems to me that you simply installed the wrong version of the library?

Comment 2 Martin Birgmeier 2020-03-08 10:14:12 UTC
The proper way to upgrade postgres with postgis is descibed in https://postgis.net/workshops/postgis-intro/upgrades.html

-- Martin
Comment 3 Harrison Grundy 2020-03-08 12:29:34 UTC
You'll need to do the following to get out of this:

1. Uninstall PostGIS 2.5
2. Reinstall PostGIS 2.4 (postgis24)
3. Run PostgreSQL update (9.4 to 9.5)
4. Use the PostGIS Update instructions, install the PostGIS 2.5 stuff.

This triggered trying to update PostgreSQL and PostGIS at once. It gets riled up at that. Portmaster can get you into some interesting places with PostGIS.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2020-03-08 12:36:57 UTC

 - This is a postgis upgrade issue *involving* concurrent posgresql update. Reclassify accordingly
Comment 5 Loïc Bartoletti freebsd_committer 2020-03-11 18:25:38 UTC
(In reply to Harrison Grundy from comment #3)
I second you on this (official) method.

koobs, may I add a pkg-message to describe the update?