Hi Lauri, This is becuase PG doesn't support INSERT IGNORE/REPLACE (as in MySQL or Oracle).
-Imran --- On Tue, 1/3/12, Lauri Kajan <[email protected]> wrote: > From: Lauri Kajan <[email protected]> > Subject: Re: [postgis-users] shp2pgsql - how to continue when error occurs > To: "PostGIS Users Discussion" <[email protected]> > Date: Tuesday, January 3, 2012, 4:16 PM > Thanks Imran, > > That was also in my mind, but thought I could have less > steps to > complete the import. > > > -Lauri > > > On Tue, Jan 3, 2012 at 11:50 AM, Nithya lakshmi > <[email protected]> > wrote: > > how to use Rtree in postgis > > > > On 1/3/12, Muhammad Imran <[email protected]> > wrote: > >> Hi Lauri, > >> > >> 1- Disable or remove unique key (UK) on table. > >> 2- Import data using shp2pgsql > >> 3- remove duplicate rows using SQL > >> DELETE > >> FROM sometable > >> WHERE someuniquekey NOT IN > >> (SELECT > MAX(dup.someuniquekey) > >> FROM > sometable As dup > >> GROUP BY dup.dupcolumn1, > dup.dupcolumn2, dup.dupcolum3) > >> > >> (http://www.postgresonline.com/journal/archives/22-Deleting-Duplicate-Records-in-a-Table.html) > >> 4- Enforce UK > >> > >> > >> -Imran > >> > >> > >> --- On Tue, 1/3/12, Lauri Kajan <[email protected]> > wrote: > >> > >>> From: Lauri Kajan <[email protected]> > >>> Subject: [postgis-users] shp2pgsql - how to > continue when error occurs > >>> To: [email protected] > >>> Date: Tuesday, January 3, 2012, 1:18 PM > >>> 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 > >>> > _______________________________________________ > >>> postgis-users mailing list > >>> [email protected] > >>> http://postgis.refractions.net/mailman/listinfo/postgis-users > >>> > >> _______________________________________________ > >> postgis-users mailing list > >> [email protected] > >> http://postgis.refractions.net/mailman/listinfo/postgis-users > >> > > _______________________________________________ > > postgis-users mailing list > > [email protected] > > http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
