PostGIS升级2.2.1-> 2.5.0数据库导入错误

时间:2018-10-29 14:25:22

标签: postgresql postgis postgresql-9.6 geos postgis-installation

我要将数据库从PostGIS 2.2.1迁移到2.5.0(PG 9.6)。我pg_dumping旧数据库,并正在使用pg_restore导入它。

一切似乎都正常,但是我遇到了这两个错误。这是我需要担心的事情还是可以忽略它们?

pg_restore: creating AGGREGATE "public.accum(geometry)"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 4925; 1255 348862 AGGREGATE accum(geometry) aed
pg_restore: [archiver (db)] could not execute query: ERROR:  type "pgis_abs" does not exist
Command was: CREATE AGGREGATE accum(geometry) (
    SFUNC = public.pgis_geometry_accum_transfn,
    STYPE = pgis_abs,
    FINALFUNC = pgis_geometry_accum_finalfn
);

和..

pg_restore: creating AGGREGATE "public.makeline(geometry)"
pg_restore: [archiver (db)] Error from TOC entry 4927; 1255 348864 AGGREGATE makeline(geometry) aed
pg_restore: [archiver (db)] could not execute query: ERROR:  type "pgis_abs" does not exist
Command was: CREATE AGGREGATE makeline(geometry) (
    SFUNC = public.pgis_geometry_accum_transfn,
    STYPE = pgis_abs,
    FINALFUNC = pgis_geometry_makeline_finalfn
);

2 个答案:

答案 0 :(得分:1)

显然,pgis_abs列是虚拟列as per this commit

  

#4035,从聚合/收集例程中删除伪pgis_abs类型

听起来像您应该能够在执行升级之前删除pgis_abs

披露:我为EnterpriseDB (EDB)工作

答案 1 :(得分:0)

我强烈建议您在还原具有postgis扩展名的pg_dumped文件时,而不是pg_restore命令本身时,使用“ postgis_restore.pl”。

https://github.com/postgis/postgis/blob/svn-trunk/utils/postgis_restore.pl.in