Re: Need some help in postgres locking mechanism

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

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(at)erven(dot)at> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Roxanne Reid-Bennett 2014-04-15 22:26:28 Re: Approach to Data Summary and Analysis
Previous Message Raymond O'Donnell 2014-04-15 17:21:01 Re: [GENARAL] round() bug