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