[postgis-users] shp2pgsql - how to continue when error occurs

Lauri Kajan lauri.kajan at gmail.com
Mon Jan 2 23:48:39 PST 2012


Hi all,

I'm trying to merge multiple shapefiles to postgis table. I know that
there is some duplicates in different files.

I thought that I could just check duplicatiness when loading shapes
with shp2pgsql.
So I first created an empty table and added a unique constraint to the
field that I know to be unique with non duplicate records.

But now when shp2pgsql tries to insert first duplicate record and
error occurs it stops and won't load any records.

Is there a way to continue when "key already exists" -error occurs?

I read that in shp2pgsql that comes with 2.0 it has -e parameter that
loads each record invidually. Is this the only way to go? Don't like
that cause I have 13GB shape files. And I would like to use Dump
dormat.



Thanks

-Lauri



More information about the postgis-users mailing list