首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PostGIS:创建扩展失败

PostGIS:创建扩展失败
EN

Stack Overflow用户
提问于 2014-04-26 06:30:13
回答 2查看 7K关注 0票数 3

我在psql中运行了命令:

代码语言:javascript
复制
my-spatial-db=# CREATE EXTENSION postgis;

并得到错误:

代码语言:javascript
复制
ERROR:  could not open extension control file "/usr/share/pgsql/extension/postgis.control": No such file or directory

my-spatial-db=# select postgis_full_version();
NOTICE:  Function postgis_gdal_version() not found.  Is raster support enabled and rtpostgis.sql installed?
NOTICE:  Function postgis_topology_scripts_installed() not found. Is topology support enabled and topology.sql installed?
NOTICE:  Function postgis_raster_scripts_installed() not found. Is raster support enabled and rtpostgis.sql installed?
NOTICE:  Function postgis_raster_lib_version() not found. Is raster support enabled and rtpostgis.sql installed?
                                 postgis_full_version                                      
-----------------------------------------------------------------------------------------------
 POSTGIS="2.0.2 r10789" GEOS="3.3.6-CAPI-1.7.6" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.9.1"


my-spatial-db=# select version();
                                                   version                                                   
-------------------------------------------------------------------------------------------------------------
PostgreSQL 9.2.7 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7), 64-bit

我从.tar安装了.tar,因为我的操作系统是AWS EC2 Amazon (在yum中没有内置的PostGIS包)

我还运行了这两个命令:

代码语言:javascript
复制
psql -d my-spatial-db -f /usr/share/pgsql/contrib/postgis-2.0/postgis.sql
psql -d my-spatial-db -f /usr/share/pgsql/contrib/postgis-2.0/spatial_ref_sys.sql

我是不是遗漏了什么?非常感谢!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-04-27 21:39:10

您的数据库需要光栅或拓扑支持吗?如果没有,那么您已经通过启用脚本在空间上启用了数据库,因为postgis_full_version()起作用了(除非需要此功能,否则忽略NOTICE )。

请注意,CREATE EXTENSION postgis是安装PostGIS的另一种方式,这与使用enabler脚本(psql -f /path/to/postgis.sql)不兼容。如果您更喜欢这种方法,那么您需要构建具有栅格支持的PostGIS (即需要libgdal-dev),并且不要运行使能脚本。

见相关答案:https://stackoverflow.com/a/22998869/327026

票数 0
EN

Stack Overflow用户

发布于 2014-05-05 05:26:24

对于RHEL 5的读者来说,这个特定的发行版不支持通过PGDG,根据这篇博客文章的PostGIS 2,因为在RHEL 5中没有合适的libgeos。

这个答案只适用于RHEL5。如果您使用的是其他东西,您可能只是没有安装PostGIS。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23307518

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档