mic*_*nko 2 postgresql postgis archlinux
我有PostgreSQL 9.3在archlinux上安装了。
我正在尝试还原psql <db_hame> < backup.file使用postgis 2.0函数,类型等的数据库备份()。我尝试使用pacman -S postgis成功安装的pacman()安装postgis(),但似乎2.0和2.1版本不兼容,因为我在数据库中抱怨很多错误而抱怨缺少函数进口:
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
Run Code Online (Sandbox Code Playgroud)
然后我尝试使用以下链接构建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。但是,构建失败并出现以下错误:
lwgeom_triggers.c: In function ‘cache_bbox’:
lwgeom_triggers.c:78:33: error: dereferencing pointer to incomplete type
tupdesc = trigdata->tg_relation->rd_att;
Run Code Online (Sandbox Code Playgroud)
整个makepkg日志:http : //pastebin.com/GGqECymZ
如何导入使用postgis 2.0的数据库?
呵呵,要使其正常工作颇具挑战性。
我无法针对postgres 9.3构建postgis 2.0.0,因此我不得不回滚到postgres 9.1.10并从源代码构建postgress和postgis。
我使用了指令从http://boringnerdystuff.wordpress.com/2012/04/14/postgis-2-0-pkgbuild-for-arch-linux/构建postgis (其本身的程序包位于github:https://github.com。 com / philbns / PostGIS-2.0-PKGBUILD)。
另一个问题是postgres软件包。我尝试了9.1.4,但由于某些错误而导致数据库初始化失败。最终,我找到了可以初始化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,然后将它们都安装。
我通过以下方式在数据库中启用了postgis扩展:
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION fuzzystrmatch;
Run Code Online (Sandbox Code Playgroud)
最后我的数据库备份导入没有任何错误。
| 归档时间: |
|
| 查看次数: |
1628 次 |
| 最近记录: |