ошибка сборки postgis 2.0.0

У меня установлен postgresql 9.3 на archlinux.

Я пытаюсь восстановить резервную копию базы данных (psql <db_hame> < backup.file), которая использует функции, типы и т. д. postgis 2.0. Я попытался установить postgis с помощью pacman (pacman -S 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

Затем я попытался собрать пакет postgis, используя следующие ссылки: http://boringnerdystuff.wordpress.com/2012/04/14/postgis-2-0-pkgbuild-for-arch-linux/ и https://github.com/philbns/PostGIS-2.0-PKGBUILD/tree/80d8af061fa73e9a09dd6ec5c204bc82b25e3 Однако сборка завершается со следующей ошибкой:

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?


person michael nesterenko    schedule 21.10.2013    source источник


Ответы (1)


Хм, было довольно сложно заставить его работать.

Я не мог собрать postgis 2.0.0 против postgres 9.3, поэтому мне пришлось откатиться до postgres 9.1.10 и собрать как postgress, так и postgis из исходников.

Я использовал инструкции для сборки postgis из http://boringnerdystuff.wordpress.com/2012/04/14/postgis-2-0-pkgbuild-for-arch-linux/ (сам пакет находится на github: https://github.com/philbns/PostGIS-2.0-PKGBUILD).

Другая проблема была с пакетом postgres. Я пробовал 9.1.4, но инициализация базы данных не удалась с какой-то ошибкой. Наконец я нашел 9.1.10, который может инициализировать db. Пакета для postgres 9.1.10 нет, поэтому я использовал пакет для postgres 9.1.4 (от https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/postgresql&id=5bd2e474704f619449287efc7310acebcaf1)10ed затем cross.1_a>10ab4 на cross.1_a10acebcaf15ab4 пальцы и надеялся, что все будет в порядке. И это сработало! Я построил postgres, затем postgis и установил их оба.

Я включил расширение postgis в своей БД с помощью:

CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION fuzzystrmatch;

И, наконец, моя резервная копия базы данных импортирована без ошибок.

person michael nesterenko    schedule 22.10.2013