Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
        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?




pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group