使用自制软件升级到PostGIS 2.1和PostgreSQL 9.3.1时缺少库

使用自制软件升级到PostGIS 2.1和PostgreSQL 9.3.1时缺少库,postgresql,upgrade,postgis,Postgresql,Upgrade,Postgis,在将PostgreSQL从9.2.4版升级到9.3.1版(通过OS X上的自制)的过程中,我遇到了一个奇怪的问题。这些是我迄今为止采取的步骤 已安装PostgreSQL、PostGIS和必需的库(无错误) 在新数据库上运行initdb 已停止两台服务器 正在运行pg\u升级 pg_upgrade执行必要的检查,创建旧集群的转储,但在导入到新集群时,我遇到以下错误: > ./pg_upgrade -b /usr/local/Cellar/postgresql/9.2.4/bin/ -B

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

  • 已安装PostgreSQL、PostGIS和必需的库(无错误)
  • 在新数据库上运行
    initdb
  • 已停止两台服务器
  • 正在运行
    pg\u升级
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

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

我最近遇到了这个问题,重新安装postgis对我很有效。也就是说,转到源文件所在的文件夹(如果从源安装了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命令时,一切都会正常工作


希望这能有所帮助。

我发现新安装的postgresql和postgis也存在同样的问题。你有没有整理过它?不幸的是,没有,我回到了PostGIS 2.0和PostgreSQL 9.2.3这是一个如此烦人和反复出现的问题,因为homebrew不断更新PostgreSQL和PostGIS,而我只每隔几个月使用一次我的数据库。。。