Re: Need some help in postgres locking mechanism

From: Vick Khera <vivek(at)khera(dot)org>
To: Hannes Erven <hannes(at)erven(dot)at>
Cc: santhosh kumar <kurasanthoshkumar(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Need some help in postgres locking mechanism
Date: 2014-04-08 17:41:44
Message-ID: CALd+dceh7be0t0B6xKuyQMLbyUsse1MTz99rG7Sh2mh00j7t+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Apr 8, 2014 at 11:28 AM, Hannes Erven <hannes(at)erven(dot)at> wrote:
> 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

That's not really skipping over the locked rows and returning the next
row, that's bailing out and retrying.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steve Kehlet 2014-04-08 17:48:56 is there a way to firmly cap postgres worker memory consumption?
Previous Message santhosh kumar 2014-04-08 16:12:23 Re: Need some help in postgres locking mechanism