首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >构建postgis 2.0.0失败

构建postgis 2.0.0失败
EN

Stack Overflow用户
提问于 2013-10-21 00:43:28
回答 1查看 1.7K关注 0票数 2

我在archlinux上安装了postgresql 9.3

我正在尝试还原使用postgis 2.0函数、类型等的数据库备份(psql <db_hame> < backup.file)。我尝试安装postgis与pacman (pacman -S postgis)一起成功安装,但似乎2.02.1版本是不兼容的,因为在数据库导入过程中有很多错误抱怨缺少函数:

代码语言:javascript
复制
ERROR:  could not find function "geography_analyze" in file "/usr/lib/postgresql/postgis-2.1.so"
ERROR:  function public.geography_analyze(internal) does not exist
ERROR:  function geography_analyze(internal) does not exist
ERROR:  could not find function "geometry_analyze_2d" in file "/usr/lib/postgresql/postgis-2.1.so"
ERROR:  function public.geometry_analyze(internal) does not exist
ERROR:  function geometry_analyze(internal) does not exist
ERROR:  type "geometry" is only a shell
ERROR:  type "public.geometry_dump" does not exist
ERROR:  type "geometry" is only a shell
ERROR:  type "public.valid_detail" does not exist
ERROR:  SQL function cannot accept shell type geography
ERROR:  function public._st_bestsrid(geography) does not exist
ERROR:  PL/pgSQL functions cannot return type geometry
ERROR:  function public._st_concavehull(geometry) does not exist
ERROR:  type "geometry_dump" does not exist
ERROR:  function public._st_dumppoints(geometry, integer[]) does not exist
ERROR:  SQL function cannot accept shell type geometry
ERROR:  function public._st_within(geometry, geometry) does not exist
ERROR:  could not find function "geography_gist_selectivity" in file "/usr/lib/postgresql/postgis-2.1.so"
ERROR:  function public.geography_gist_join_selectivity(internal, oid, internal, smallint) does not exist
ERROR:  could not find function "geography_gist_selectivity" in file "/usr/lib/postgresql/postgis-2.1.so"
ERROR:  function public.geography_gist_selectivity(internal, oid, internal, integer) does not exist
ERROR:  could not find function "geometry_gist_joinsel_2d" in file "/usr/lib/postgresql/postgis-2.1.so"
ERROR:  function public.geometry_gist_joinsel_2d(internal, oid, internal, smallint) does not exist
ERROR:  could not find function "geometry_gist_sel_2d" in file "/usr/lib/postgresql/postgis-2.1.so"
ERROR:  function public.geometry_gist_sel_2d(internal, oid, internal, integer) does not exist

然后,我尝试使用以下链接构建postgis包:http://boringnerdystuff.wordpress.com/2012/04/14/postgis-2-0-pkgbuild-for-arch-linux/https://github.com/philbns/PostGIS-2.0-PKGBUILD/tree/80d8af061fa73e9a09dd6ec5c204bc4b65e38202。但是,生成失败,有以下错误:

代码语言:javascript
复制
lwgeom_triggers.c: In function ‘cache_bbox’:
lwgeom_triggers.c:78:33: error: dereferencing pointer to incomplete type
  tupdesc = trigdata->tg_relation->rd_att;

和整个makepkg日志:http://pastebin.com/GGqECymZ

如何导入使用postgis 2.0的数据库?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-22 08:39:10

嗯,要让它起作用是很有挑战性的。

我无法针对postgres 9.3构建postgis 2.0.0,所以我不得不回滚到postgres 9.1.10,并从源代码构建postgres和postgis。

我使用指令从http://boringnerdystuff.wordpress.com/2012/04/14/postgis-2-0-pkgbuild-for-arch-linux/构建postgis (它本身就是github:https://github.com/philbns/PostGIS-2.0-PKGBUILD上的包)。

另一个问题是postgres包裹。我尝试了9.1.4,但是它失败了db初始化,有一些错误。最后,我找到了能够初始化db的9.1.10。没有postgres 9.1.10包,所以我使用postgres 9.1.4包(来自https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/postgresql&id=5bd2e474704f619449287efc7310acebcaf15ab4),然后将pkgver改为9.1.10祈祷,希望一切顺利。这起作用了!我建造了postgres,然后postgis安装了它们。

我在我的db中启用了postgis扩展名:

代码语言:javascript
复制
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION fuzzystrmatch;

最后,导入我的db备份,没有任何错误。

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

https://stackoverflow.com/questions/19484632

复制
相关文章

相似问题

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