skipping records with duplicate key during COPY

From: "Devinder K Rajput" <Devinder(dot)Rajput(at)ipaper(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: skipping records with duplicate key during COPY
Date: 2002-12-18 19:16:15
Message-ID: OFA585A509.CC7CFFD7-ON86256C93.0068E08F@ipaper.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,
I am using COPY command to load a data table. When I try to
insert a record with a duplicate key, I get the error message "cannot
insert a duplicate key into unique index" and no data is loaded into the
table. I know that this is the way the COPY command works. Now, is there
a way in which I can load a table and if duplicate records do come up,
write them to an error file, but still load the other good records into
the table? *I think* one of accomplishing this is by performing inserts
of individual records, but that would be very slow. any suggestions?

TIA,

Devinder

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Devinder K Rajput 2002-12-18 21:38:25 Reserved Word
Previous Message Patrick Hatcher 2002-12-18 16:08:54 Re: Cant group by non integer - ms access - odbc