6
votes

I was running PostgreSQL 9.1 and I am trying to upgrade to PostgreSQL 9.3:

$ /usr/lib/postgresql/9.3/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.3/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.3/main/ -O "-c config_file=/etc/postgresql/9.3/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"

However it fails with:

Checking for presence of required libraries fatal

Your installation references loadable libraries that are missing from the new installation. You can add these libraries to the new installation, or remove the functions using them from the old installation. A list of problem libraries is in the file: loadable_libraries.txt

loadable_libraries.txt contains:

Could not load library "$libdir/postgis-1.5" ERROR: could not access file "$libdir/postgis-1.5": No such file or directory

It is similar to Missing libraries when upgrading to PostGIS 2.1 and PostgreSQL 9.3.1 using homebrew.

I am running Ubuntu and I have install PostgreSQL with PostGIS using apt-get.

Anyone managed that?

1
I'd try and find any directory named postgis-1.5 and by its location, deduce where it should be copied in the new version. If that doesn't work, perhaps you should uninstall postgis1.5, upgrade and then add postgis 2.1 using CREATE EXTENSION.ffflabs
Can I uninstall postgis while having database that has geometry data?TN.

1 Answers

4
votes

Since PostGIS 1.5 is not supported with PostgreSQL 9.3, you are also upgrading PostGIS versions. Since pg_upgrade cannot be used for this, you will need to follow the hard upgrade procedure, which utilises logic in a postgis_restore.pl script that comes with PostGIS. If you have any further questions with the procedure, amend them to this question.