I am running PostGIS on Linux Mint 17.2 using versions in ubuntugis-unstable PPA. I recently updated from 2.1.4+dfsg-3~trusty to 2.2.2+dfsg-2~trusty0. Using soft upgrade instructions http://postgis.net/docs/postgis_installation.html#soft_upgrade_extensions I tried:


However, the result is:

ERROR:  could not access file "$libdir/postgis-2.2": No such file or directory

Other info:

$ pg_config --libdir
$ pg_config --pkglibdir

Neither location has a postgis-2.2 folder. Extension control files and upgrade scripts (such as postgis--2.1.4--2.2.2.sql) are in /usr/share/postgresql/9.3/extension. Additionally, I have a /usr/share/postgresql/9.3/contrib/postgis-2.2 folder which has the postgis_upgrade.sql file, which is littered with references to $libdir/postgis-2.2. Presumably this is the script that gets called by the ALTER EXTENSION statement, triggering the "no such" error.

How can I correctly do a soft upgrade? I am trying to avoid doing a dump and reload of the data.

  • Is postgis-2.2.so in /usr/lib/postgresql/9.3/lib? If you run ldd on it, does the system find every dependent library? – Paul Ramsey Aug 10 '16 at 13:01
  • @PaulRamsey No, there is no postgis-2.2.so file in that dir. – Lee Hachadoorian Aug 10 '16 at 13:25
  • Anywhere on the system at all? find / -name postgis-2.2.so If not, your package is broken, you can't have postgis without the library file. – Paul Ramsey Aug 10 '16 at 13:47
  • Nowhere on system. I did previously have a working PostGIS 2.1, but there is also no postgis-2.1.so in that dir. Would there have been one that was then removed during upgrade? Should I try downgrading? – Lee Hachadoorian Aug 10 '16 at 14:04
  • Sounds like your ALTER EXTENSION UPGRADE failed mid-way, which means thanks to transaction integrity your database probably still thinks it's 2.1. Does your database still work (do spatial things?). If not, then yes, you'll need to try and downgrade your Mint package to 2.1 to get a working .so file back in place. – Paul Ramsey Aug 10 '16 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.