Re: Question on locking

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Tucknott <steve(at)retsol(dot)co(dot)uk>
Cc: PostGreSQL <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Question on locking
Date: 2004-11-05 15:33:53
Message-ID: 26299.1099668833@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Steve Tucknott <steve(at)retsol(dot)co(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message John-Paul Delaney 2004-11-05 15:41:41 Re: Install 7.4.6 on Redhat 8.0 - Any issues?
Previous Message Harry Stangel 2004-11-05 15:33:51 function parse error