PostGIS upgrade 2.2.1 -> 2.5.0 Database Import Errors

旧时模样 提交于 2020-01-04 14:18:32

问题


I'm moving a database from PostGIS 2.2.1 to 2.5.0 (PG 9.6). I pg_dumped the old database and am using pg_restore to import it.

Everything appears to go fine but I'm getting these two errors. Is this something I need to worry about or can just ignore them?

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
);

and..

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
);

回答1:


Apparently, the pgis_abs column is a dummy column, as per this commit:

#4035, remove dummy pgis_abs type from aggregate/collect routines

Sounds like you should be able to drop the pgis_abs column before performing the upgrade

Disclosure: I work for EnterpriseDB (EDB)




回答2:


I strongly recommend you should use "postgis_restore.pl" when restore the pg_dumped file with postgis extension, not pg_restore command itself.

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



来源:https://stackoverflow.com/questions/53047614/postgis-upgrade-2-2-1-2-5-0-database-import-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!