Re: skip duplicate key error during inserts - Mailing list pgsql-general

From Jeffrey Webster
Subject Re: skip duplicate key error during inserts
Date
Msg-id 8c0cc2820610220239r62ff82dap95d756e17bfe8413@mail.gmail.com
Whole thread Raw
In response to skip duplicate key error during inserts  (Jean-Christophe Roux <jcxxr@yahoo.com>)
Responses Re: skip duplicate key error during inserts
List pgsql-general


On 10/20/06, Jean-Christophe Roux <jcxxr@yahoo.com> wrote:
Hello,
[snip]

 

none of them will be inserted because the first insert is a primary key violation. How can I have postgreSQL not mind about the error and proceed to the next insert. I could send the inserts one at a time but bundling them speeds up the process.
Thanks


I feel your pain... However, there is no way to do this (currently?).  Some possible solutions had been suggested some time back by a colleague, but they were rejected.  It requires a source code change (and not a simple one, at that) to implement.

Until a concensus is reached by the primary contributors there is no easy answer.

We've resorted to batch loading and parsing error messages to load all data between primary key violations.  It's still considerably more efficient than single inserts.

(we've got the code to accomplish what you're asking about in the attic... hopefully something will come of it some day.)

Best of luck.

pgsql-general by date:

Previous
From: Thomas Pundt
Date:
Subject: Re: How to find out about zlib compression
Next
From: Ron Johnson
Date:
Subject: Re: skip duplicate key error during inserts