Question on locking - Mailing list pgsql-novice

From Steve Tucknott
Subject Question on locking
Date
Msg-id 1099640185.1245.15.camel@retsol1
Whole thread Raw
Responses Re: Question on locking  (Michael Fuhr <mike@fuhr.org>)
Re: Question on locking  (Terry Lee Tucker <terry@esc1.com>)
Re: Question on locking  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
PostGreSQL 7.4.5

If I have the situation where process 1 has selected record1 from table a for update and then process 2 tries to do the same, am I right in assuming that process 2 will wait until the first process completes the transaction (I've looked at Chapter 12 and this is intimated).
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?
Is the suggested route to interrogate the system tables prior to selecting for update, to see if a lock has been applied?

Normally we wait on locks , so this is not an issue.


Regards,

Steve Tucknott

ReTSol Ltd

DDI: 01903 828769

pgsql-novice by date:

Previous
From: "John-Paul Delaney"
Date:
Subject: Re: pg_ [dump & restore] invalid archive problem
Next
From: "M. Bastin"
Date:
Subject: Re: Question on locking