Search Postgresql Archives

Re: duplicate key violates unique constraint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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.




---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux