将postgis扩展名安装到postgresql数据库时出错

将postgis扩展名安装到postgresql数据库时出错

本文介绍了将postgis扩展名安装到postgresql数据库时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将postgis安装到现有数据库时遇到问题.但出现这样的错误:

Im having problem installing postgis to an existing database.but getting error like this:

ERROR:  could not load library "/usr/local/pgsql/lib/postgis-2.0.so": libgeos_c.so.1: cannot open shared object file: No such file or directory

postgis-2.0.so在/usr/local/pgsql/lib/postgis-2.0.so中没问题. libgeos_c.so.1安装在/usr/local/lib中.

the postgis-2.0.so is in /usr/local/pgsql/lib/postgis-2.0.so no problem. the libgeos_c.so.1 is installed in /usr/local/lib.

那么,这是什么问题?

任何帮助将不胜感激.

谢谢.

顺便说一句,我安装了所有这些内容,然后安装了本教程:

BTW, I installed all these followed by this tutorial:

http://www.codingsteps.com /installing-and-configuring-postgresql-in-amazon-linux-ami/

更新

$ ldd /usr/local/lib/libgeos_c.so.1
linux-vdso.so.1 =>  (0x00007fff6f55b000)
libgeos-3.3.7.so => /usr/local/lib/libgeos-3.3.7.so (0x00007f53700d9000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f536fdd0000)
libm.so.6 => /lib64/libm.so.6 (0x00007f536fb4c000)
libc.so.6 => /lib64/libc.so.6 (0x00007f536f7c0000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f536f5ab000)
/lib64/ld-linux-x86-64.so.2 (0x00007f537068d000)

推荐答案

仅使用明智的Linux发行版(如Ubuntu,Debian,Fedora,RHEL等),方式就更容易了. http://apt.postgresql.org/ http://yum.postgresql.org/适当,并预先构建所有这些东西并易于安装.亚马逊的PostgreSQL包装在不称职的情况下存在不安全边界,应避免使用.

It's way easier to just use a sensible Linux distro like Ubuntu, Debian, Fedora, RHEL, etc. You can then just use http://apt.postgresql.org/ or http://yum.postgresql.org/ as appropriate and get all this stuff pre-built and easy to install. Amazon's PostgreSQL packaging is unsafe bordering on incompetent and should be avoided.

我怀疑直接的问题是/usr/local/lib不在LD_LIBRARY_PATH和/或/etc/ld.so.conf上,因此当PostgreSQL dlopen(...)postgis-2.0.so时,它尝试解析libgeos_c.so.1并找不到它.

I suspect the immediate problem is /usr/local/lib not being on LD_LIBRARY_PATH and/or in /etc/ld.so.conf, so when PostgreSQL dlopen(...)'s postgis-2.0.so it tries to resolve libgeos_c.so.1 and fails to find it.

另一种可能性是,如果/usr/local/lib/libgeos_c.so.1是指向不存在的文件的符号链接.

Another possibility would be if /usr/local/lib/libgeos_c.so.1 is a symbolic link to a file that does not exist.

这篇关于将postgis扩展名安装到postgresql数据库时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 19:47