Litao Wu <[EMAIL PROTECTED]> writes:
> How about:
> select c.relname, l.pid, l.mode, l.granted,
> a.current_query
> from pg_locks l, pg_class c, pg_stat_activity a
> where
> l.relation = c.oid
> AND l.pid = a.procpid
> order by l.granted, l.pid;
You can't join to pg_class without eliminating
Thank you.
How about:
select c.relname, l.pid, l.mode, l.granted,
a.current_query
from pg_locks l, pg_class c, pg_stat_activity a
where
l.relation = c.oid
AND l.pid = a.procpid
order by l.granted, l.pid;
relname | pid |
mode | granted |
Litao Wu <[EMAIL PROTECTED]> writes:
> Did I miss something?
Your join omits all transaction locks.
regards, tom lane
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Hi Tom,
No row has granted='f'.
The result shown in the original email is from:
select c.relname, l.pid, l.mode, l.granted,
current_query
from pg_locks l, pg_class c, pg_stat_activity a
where relation is not null
AND l.relation = c.oid
AND l.pid = a.procpid
AND l.mode != 'AccessShareLock'
o
Litao Wu <[EMAIL PROTECTED]> writes:
> Here is info from pg_lock:
All those locks are already granted, so they are not much help in
understanding what PID 18951 is waiting for. What row does it have
with granted = 'f' ?
regards, tom lane
---(end o