From: | Rob Northcott <Rob(at)teamsystems(dot)co(dot)uk> |
---|---|
To: | "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org> |
Subject: | Get details of user locking a record? |
Date: | 2010-05-12 14:22:58 |
Message-ID: | 4300547FCC2E2A4EA97985D577953D2E8E45E4ADF8@SERVER.team.local |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hello list,
I'm pretty new to SQL servers, so this may be a silly question, but here goes anyway...
When a user tries to edit a record (SELECT * FROM mytable WHERE key = 'mykey' FOR UPDATE NOWAIT) and it is locked by another user, I can trap the error and tell the user it is locked. No problems there. But is it possible to find out what other user (name or ip address?) is doing the locking? I've done lots of web searching and it seems like it's considered a bad idea to lock records in database applications - but I don't want my users to spend ages editing, say, a customer's address or notes, only to be told they can't save the changes because somebody else has edited it in the meantime.
Is there an easy way (or any way for that matter) to find out who owns the lock on a specific record or a table?
Rob Northcott
Programmer, Team Systems Ltd.
Attachment | Content-Type | Size |
---|---|---|
AVG certification.txt | text/plain | 93 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Tony Day | 2010-05-12 20:05:16 | Re: Get details of user locking a record? |
Previous Message | Atif Jung | 2010-05-12 13:31:09 | Interrupt |