【问题标题】:How to upgrade PostgreSQL with PostGIS?如何使用 PostGIS 升级 PostgreSQL?
【发布时间】:2014-05-18 05:56:41
【问题描述】:

我运行的是 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"

但是它失败了:

检查是否存在致命的必需库

您的安装引用了缺少的可加载库 新安装。您可以将这些库添加到新的 安装,或从旧版本中删除使用它们的功能 安装。问题库列表在文件中: loadable_libraries.txt

loadable_libraries.txt 包含:

无法加载库“$libdir/postgis-1.5”错误:无法访问 文件 "$libdir/postgis-1.5": 没有这样的文件或目录

类似于Missing libraries when upgrading to PostGIS 2.1 and PostgreSQL 9.3.1 using homebrew

我正在运行 Ubuntu,我已经使用 apt-get 安装了带有 PostGIS 的 PostgreSQL。

有人做到了吗?

【问题讨论】:

  • 我会尝试找到任何名为postgis-1.5 的目录,并根据它的位置推断它应该在新版本中复制到哪里。如果这不起作用,也许您应该卸载 postgis1.5,升级然后使用 CREATE EXTENSION 添加 postgis 2.1。
  • 我可以在拥有包含几何数据的数据库时卸载 postgis 吗?

标签: postgresql ubuntu postgis postgresql-9.3


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2013-04-21
    • 2017-07-26
    • 2013-11-05
    • 1970-01-01
    • 2013-08-06
    • 2019-01-12
    • 1970-01-01
    • 2023-02-02
    • 2023-01-17
    相关资源
    最近更新 更多