【问题标题】:Missing libraries when upgrading to PostGIS 2.1 and PostgreSQL 9.3.1 using homebrew使用自制软件升级到 PostGIS 2.1 和 PostgreSQL 9.3.1 时缺少库
【发布时间】:2013-11-05 00:34:28
【问题描述】:

在将我的 PostgreSQL 从版本 9.2.4 升级到 9.3.1(通过 OS X 上的自制软件)的过程中,我遇到了一个奇怪的问题。这些是我到目前为止所采取的步骤

  • PostgreSQL、PostGIS 和所需库已安装(无错误)
  • 在新数据库上运行initdb
  • 停止两台服务器
  • 正在运行pg_upgrade

pg_upgrade 执行必要的检查,创建旧集群的转储,但在导入新集群时出现以下错误:

> ./pg_upgrade -b /usr/local/Cellar/postgresql/9.2.4/bin/ -B /usr/local/Cellar/postgresql/9.3.1/bin -d /usr/local/var/postgres/ -D /usr/local/var/postgres9.3.1 -u postgres
Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
Checking database user is a superuser                       ok
Checking for prepared transactions                          ok
Checking for reg* system OID user data types                ok
Checking for contrib/isn with bigint-passing mismatch       ok
Creating dump of global objects                             ok
Creating dump of database schemas
                                                            ok
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

Failure, exiting

似乎 PostgreSQL 9.3.1 尝试使用不兼容的 PostGIS 2.0

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

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

有人遇到过同样的问题吗?

【问题讨论】:

  • 我在新安装的 postgresql 和 postgis 中看到了同样的问题。你解决了吗?
  • 不幸的是,我正在恢复到 PostGIS 2.0 和 PostgreSQL 9.2.3
  • 这是一个烦人且反复出现的问题,因为自制软件会不断更新 postgresql 和 postgis,而我每隔几个月才使用一次数据库...

标签: postgresql upgrade postgis


【解决方案1】:

我最近遇到了这个问题,重新安装 postgis 对我有用。也就是说,转到您对源文件进行 tar 处理的文件夹(如果您从源代码安装了 postgis)并重新运行:

./configure
make
sudo make install

如果你安装了最新版本的 postgresql,postgis 应该安装到新的 postgresql 的扩展文件夹中:

/usr/share/postgresql/x.x/extension/

要检查,请运行:

sudo su -l postgres

psql template1 -p 5433

SELECT name, default_version,installed_version 
FROM pg_available_extensions WHERE name LIKE 'postgis%' ;

如果 postgis 已成功安装,您应该会在“已安装”列中看到版本号。现在,当您尝试运行 pg_upgrade 命令时,一切正常。

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 2014-05-18
    • 2015-01-18
    • 1970-01-01
    • 2011-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多