我已经多次安装 PostgreSQL 9.x 和 PostGIS 1.5/2.0,从来没有遇到过这个问题。
我刚刚启动并运行了一个新的 CentOS 6.3 服务器,而且我的 Postgres 9.3 也按预期运行。我跑了
yum install postgis2_93
我可以看到里面的文件
/usr/pgsql-9.3/share/contrib/
然而,当我运行时
CREATE EXTENSION postgis;
我收到了
ERROR: could not open extension control file "/usr/pgsql-9.3/share/extension/postgis.control": No such file or directory
我使用的教程(#1、#2)没有显示安装 PostGIS 和创建扩展之间的任何步骤。
我错过了什么?
最佳答案
更新: 团队刚刚发布了解决问题的 postgis.2.1.0-3 RPM 包:现在扩展可用:
/usr/pgsql-9.3/share/extension/postgis.control
结束更新。 [...]
我决定从源代码编译 POSTGIS。 这是 CentOS 6.4 64 位的分步操作:
wget http://download.osgeo.org/postgis/source/postgis-2.1.0.tar.gz
tar xvf postgis-2.1.0.tar.gz
cd postgis-2.1.0
./configure --with-pgconfig=/usr/pgsql-9.3/bin/pg_config --without-raster
make
make comments
make install
make install-comments
su - postgres
cd /usr/pgsql-9.3/share/contrib/postgis-2.1/
psql -d postgres -f postgis.sql
psql -d postgres -f spatial_ref_sys.sql
psql -d postgres -f postgis_comments.sql
psql -d postgres -f topology.sql
psql -d postgres -f topology_comments.sql
关于postgresql - 尝试运行创建扩展 postgis 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18768644/