Search Postgresql Archives

Re: Duplicate key error

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

 



Hi!

>I just meant a regular update (which might impact 0 rows) and then insert (not exists) like you are doing already.

This causes duplicate key exception if other process adds same row to table at same time.


>--transaction still ways. Should manual locking used or is there better method.
>I don't follow what you mean.

Allow access to this table for single transaction only. Wait for exclusive lock , do update/insert, release exclusive lock.

Andrus.


[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 Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux