Tom Lane wrote:
>
> Fair enough, it would do that. But you still need the surrounding retry
> logic to cope when a collision does happen.
Why retry logic? I thought that if there was a collision one of the
insert attempts would necessarily succeed and all the others fails. So
no need for a retry since the record (pk) was inserted.
What I am trying to duplicate is if an inserts into a primary key field
is a duplicate it fails silently. If it isn't or there are multiple
attempts at the same time to insert the *same* new primary key, the new
pk is inserted.
The suggested method does guarantee an insert if it there is a collision
right? If not I need to find a new solution :(
Jean-Christian Imbeault