Re: Need some help in postgres locking mechanism

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

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message santhosh kumar 2014-04-08 16:12:23 Re: Need some help in postgres locking mechanism
Previous Message Vick Khera 2014-04-08 13:53:06 Re: SSD Drives