On 10/20/06, Jean-Christophe Roux <jcxxr@xxxxxxxxx> 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.