Re: Question on locking - Mailing list pgsql-novice

From Tom Lane
Subject Re: Question on locking
Date
Msg-id 26299.1099668833@sss.pgh.pa.us
Whole thread Raw
In response to Question on locking  (Steve Tucknott <steve@retsol.co.uk>)
List pgsql-novice
Steve Tucknott <steve@retsol.co.uk> writes:
> How can I detect the lock on process 2? I want to be able to tell the
> user that the row is tentatively locked and to allow them to abort the
> update attempt. I can't see a 'SET LOCK MODE TO NOT WAIT' style command,
> so how do I stop process 2 from waiting?

I see the thread moved off in a different direction, but to answer your
original question: what I'd probably do is set STATEMENT_TIMEOUT to the
maximum length of time I was willing to wait for the lock.  (This
assumes of course that the time spent to find the row is reasonably
predictable, since you have to allow for that too.)

            regards, tom lane

pgsql-novice by date:

Previous
From: Kjetil Haaland
Date:
Subject: result from where clause
Next
From: "John-Paul Delaney"
Date:
Subject: Re: Install 7.4.6 on Redhat 8.0 - Any issues?