Orn*_*son 14 postgresql postgis
我有Postgres版本8.4.8
select version();
PostgreSQL 8.4.8 on i686-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5, 32-bit
Run Code Online (Sandbox Code Playgroud)
通过synaptic包管理器安装Postgis,(postgis和postgresql-8.4-postgis)一切似乎都没问题.然后,当我尝试验证Postgis版本时,事情并不顺利.这两个都给出了同样的错误.
SELECT PostGIS_version();
SELECT PostGIS_full_version();
ERROR: function postgis_full_version() does not exist
LINE 1: SELECT PostGIS_full_version();
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Run Code Online (Sandbox Code Playgroud)
软件包管理器声称已安装Postgis.如何验证安装是否有效?
Erw*_*ter 32
需要为每个数据库安装PostGIS .现有数据库不会自动更改.运行安装脚本,如下所示.
在PostgreSQL 8.4中,您可能还需要创建语言plpgsql.对于9.0+,它是默认的过程语言并自动安装.在您的数据库中:
createlang plpgsql yourdatabase
Run Code Online (Sandbox Code Playgroud)
不能伤害.如果已经安装了plpgsql,它只会产生错误告诉你.转到安装目录.在Debian Squeeze中,contrib包位于此处(在Ubuntu中可能有所不同).在一个shell中:
cd /usr/share/postgresql/8.4/contrib/postgis-1.5
Run Code Online (Sandbox Code Playgroud)
然后执行(作为postgres用户或你必须提供用户名/密码):
psql -d yourdatabase -f postgis.sql
psql -d yourdatabase -f spatial_ref_sys.sql
Run Code Online (Sandbox Code Playgroud)
您可能还希望将注释安装到闪亮的新功能(可选).在Debian Squeeze中,安装文件位于/ contrib主目录中:
cd /usr/share/postgresql/8.4/contrib
psql -d yourdatabase -f postgis_comments.sql
Run Code Online (Sandbox Code Playgroud)
如果希望PostGIS 默认安装在群集中的每个新数据库中,也请将其安装到template1数据库中.在手册中阅读更多相关内容.
http://postgis.net/docs/manual-2.1/postgis_installation.html
http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
使用PostgreSQL 9.1或更新版本,您可以使用更方便CREATE EXTENSION:
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
Run Code Online (Sandbox Code Playgroud)
您的发行版可能已准备好安装扩展程序.如果没有,请考虑PostGIS手册中的"构建PostGIS扩展和部署它们"一章.
| 归档时间: |
|
| 查看次数: |
13924 次 |
| 最近记录: |