postgresql - 如何使用 PostGIS 升级 PostgreSQL?

标签 postgresql ubuntu postgis postgresql-9.3

我正在运行 PostgreSQL 9.1,我正在尝试升级到 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"

但是它失败了:

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,我已经使用 apt-get 安装了 PostgreSQL 和 PostGIS。

有人成功过吗?

最佳答案

PostGIS 1.5 is not supported with PostgreSQL 9.3 ,您还升级了 PostGIS 版本。由于 pg_upgrade 不能用于此,您需要遵循 hard upgrade procedure ,它利用了 PostGIS 附带的 postgis_restore.pl 脚本中的逻辑。如果您对该程序有任何其他疑问,请将其修改为该问题。

关于postgresql - 如何使用 PostGIS 升级 PostgreSQL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22887881/

相关文章:

javascript - 如何使用 sequelize.js 和 PostGIS 通过邻近度正确查找对象?

sql - 比较外键 - PostgreSQL

python - 带有参数的 SQLAlchemy NOT IN 子句

tsql - T-SQL 中是否存在与 SELECT @@ROWCOUNT 等效的 PostgreSQL?

shell - 用 shell 格式化数字

python - 如何使用 Python 和 pexpect 在多个 session 中运行 linux 可执行文件

python-3.x - Ubuntu python 使用 sudo 导入tensorflow错误

java图像白色提取

c - c 函数结束后数组被释放?

database - 为什么将数据两次添加到同一表?