使用自制软件升级到PostGIS 2.1和PostgreSQL 9.3.1时缺少库 [英] Missing libraries when upgrading to PostGIS 2.1 and PostgreSQL 9.3.1 using homebrew
问题描述
在将PostgreSQL从9.2.4版本升级到9.3.1的过程中(通过OS X上的自制软件),我遇到了一个奇怪的问题.这些是我到目前为止所采取的步骤
In the process of upgrading my PostgreSQL from version 9.2.4 to 9.3.1 (via homebrew on OS X) I came across an odd problem. These are the steps I took so far
- 已安装PostgreSQL,PostGIS和所需的库(无错误)
- 在新数据库上运行
initdb
- 停止了两个服务器
- 运行
pg_upgrade
- PostgreSQL, PostGIS and required libraries installed (no errors)
- run
initdb
on the new database - stopped both servers
- running
pg_upgrade
pg_upgrade
执行必要的检查,创建旧集群的转储,但是当导入新集群时,出现以下错误:
pg_upgrade
performs the necessary checks, creates dumps of the old cluster, but when importing into the new cluster I get the following error:
> ./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
It appears as though PostgreSQL 9.3.1 tries to use PostGIS 2.0, which is not compatible
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
有人遇到同样的问题吗?
Has anyone run into the same problem?
推荐答案
我最近遇到了这个问题,重新安装了postgis对我有用.也就是说,转到您在其中压缩了源文件的文件夹(如果您从源安装了Postgis)并重新运行:
I recently ran into this problem and re-installing postgis worked for me. That is, go to the folder in which you tar'ed the source file (if you installed postgis from source) and re-run:
./configure
make
sudo make install
如果您安装了最新版本的postgresql,则postgis应该安装到新的postgresql的扩展文件夹中:
If you've installed the latest version of postgresql, postgis should install into the new postgresql's extension folder:
/usr/share/postgresql/x.x/extension/
/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命令时,一切都应该正常工作.
If postgis has successfully installed, you should see the version number indicated in the "installed" column. Now when you try running the pg_upgrade command, everything should work fine.
希望这会有所帮助.
这篇关于使用自制软件升级到PostGIS 2.1和PostgreSQL 9.3.1时缺少库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!