2014-04-05 46 views
7

我運行的PostgreSQL 9.1,我試圖升級到PostgreSQL 9.3:如何用PostGIS升級PostgreSQL?

$ /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"

但是它失敗:

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包含:

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

這是一個類似Missing libraries when upgrading to PostGIS 2.1 and PostgreSQL 9.3.1 using homebrew

我正在運行Ubuntu,我已經使用PostgreSQL使用apt-get安裝PostgreSQL。

任何人管理它?

+0

我試着找到任何名爲'''''postgis-1.5'''的目錄,並根據它的位置,推斷它應該在新版本中複製的位置。如果這不起作用,也許你應該卸載postgis1.5,升級,然後使用''CREATE EXTENSION'''添加postgis 2.1。 – amenadiel

+0

我可以使用具有幾何數據的數據庫來卸載postgis嗎? –

回答

4

由於PostGIS 1.5 is not supported with PostgreSQL 9.3,您還在升級PostGIS版本。由於pg_upgrade不能用於此目的,因此您需要遵循hard upgrade procedure,該文件利用PostGIS附帶的postgis_restore.pl腳本中的邏輯。如果您對該過程有任何其他問題,請將其修改爲此問題。

+0

+1好的,試圖做到這一點。 –