Re: duplicate key violates unique constraint - Mailing list pgsql-general

From Csaba Nagy
Subject Re: duplicate key violates unique constraint
Date
Msg-id 1118676122.2720.24.camel@coppola.muc.ecircle.de
Whole thread Raw
In response to Re: duplicate key violates unique constraint  (Richard Huxton <dev@archonet.com>)
Responses Re: duplicate key violates unique constraint  (Richard Huxton <dev@archonet.com>)
List pgsql-general
[snip]
> If you have more than one client, this can always happen. You have two
> choices:
>   1. Use a lock to stop two clients interacting like this

This won't work unless you make all the clients serialized, or you have
all the ip's already inserted in the data base... you can't lock on an
unknown key, otherwise the locking will also need to insert, and you're
back to the same race condition ;-)

Cheers,
Csaba.




pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: mirroring oracle database in pgsql
Next
From: Richard Huxton
Date:
Subject: Re: duplicate key violates unique constraint