Search Postgresql Archives

Re: Need some help in postgres locking mechanism

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

 



Hi
I am locking some rows using select for update(nowait=true) inside a transaction.If server in which code exists crashes,locks will be on rows.Those should be removed manually.I donot want that.I want to keep a timeout for that transaction.Could you please helpme out with a solution for this issue.i did not get a proper solution from internet.


On Tue, Apr 8, 2014 at 8:58 PM, Hannes Erven <hannes@xxxxxxxx> wrote:
Hi,


On 2014-04-08 15:27, Vick Khera wrote:
[...]

Problem 2: you cannot have a second process skip over locked rows.


In fact, you can: use "FOR UPDATE NOWAIT" and catch any errors.

e.g. SELECT * FROM jobqueue WHERE id=? FOR UPDATE NOWAIT



-hannes



--
K.Santhosh Kumar


[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