我在psql中运行了命令:
my-spatial-db=# CREATE EXTENSION postgis;并得到错误:
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包)
我还运行了这两个命令:
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我是不是遗漏了什么?非常感谢!
发布于 2014-04-27 21:39:10
您的数据库需要光栅或拓扑支持吗?如果没有,那么您已经通过启用脚本在空间上启用了数据库,因为postgis_full_version()起作用了(除非需要此功能,否则忽略NOTICE )。
请注意,CREATE EXTENSION postgis是安装PostGIS的另一种方式,这与使用enabler脚本(psql -f /path/to/postgis.sql)不兼容。如果您更喜欢这种方法,那么您需要构建具有栅格支持的PostGIS (即需要libgdal-dev),并且不要运行使能脚本。
发布于 2014-05-05 05:26:24
对于RHEL 5的读者来说,这个特定的发行版不支持通过PGDG,根据这篇博客文章的PostGIS 2,因为在RHEL 5中没有合适的libgeos。
这个答案只适用于RHEL5。如果您使用的是其他东西,您可能只是没有安装PostGIS。
https://stackoverflow.com/questions/23307518
复制相似问题