Re: [GENERAL] 8.1.2 locking issues

2006-11-09 Thread Tom Lane
"Ed L." <[EMAIL PROTECTED]> writes: > Can someone explain why 6508 has a transactionid ExclusiveLock, > but now is waiting on a transactionid ShareLock? That seems > unintuitive. It would seem that if you hold a more exclusive > lock, getting a less exclusive lock would not be a problem. They're

Re: [GENERAL] 8.1.2 locking issues

2006-11-09 Thread Ed L.
I have a few questions on pgsql locking terms and such... I created the following view to make viewing the locks a little easier: -- CREATE OR REPLACE VIEW locksview AS -- SELECT l.*, r.*, a.*, now() - a.query_start as query_age, --substring(replace(current_query, '\n', ' '), 1, 30) as

Re: [GENERAL] 8.1.2 locking issues

2006-11-08 Thread Talha Khan
Hi Ed,In order to get which entities are responsible for the lock that you have try using the following query. select loc.pid , cls.relname,loc.granted as lock_status from pg_locksĀ  loc , pg_class cls where loc.locktype like '%sharelock%' and cls.oid=loc.relation and loc.pid in(pids of the process

Re: [GENERAL] 8.1.2 locking issues

2006-11-08 Thread Alvaro Herrera
Ed L. wrote: > > We are having locking issues in 8.1.2 on HP 11.23 ia64. I'm > trying to better understand how to conclusively identify who is > waiting on who and why. > > We have a series of "select for updates" on our 'sessions' table. > One of those queries is stuck waiting for a "transa