Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade PostgreSQL with PostGIS?

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?

like image 331
TN. Avatar asked Apr 05 '14 22:04

TN.


1 Answers

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.

like image 70
Mike T Avatar answered Sep 20 '22 11:09

Mike T