Question on locking

From: Steve Tucknott <steve(at)retsol(dot)co(dot)uk>
To: PostGreSQL <pgsql-novice(at)postgresql(dot)org>
Subject: Question on locking
Date: 2004-11-05 07:36:22
Message-ID: 1099640185.1245.15.camel@retsol1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message M. Bastin 2004-11-05 08:54:46 Re: Question on locking
Previous Message John-Paul Delaney 2004-11-05 05:36:36 Re: pg_ [dump & restore] invalid archive problem