From: | Aleksey Tsalolikhin <atsaloli(dot)tech(at)gmail(dot)com> |
---|---|
To: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | How can you have an Exclusive Lock on nothing? please help me understand this lock monitoring query output |
Date: | 2011-04-15 01:12:16 |
Message-ID: | BANLkTi=N4PPTGmFGrn+sy6WD1ZcCH8w=mw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi. I use the following query (from
http://wiki.postgresql.org/wiki/Lock_Monitoring)
to monitor locks; and I've got an ExlusiveLock that does not have a relation
name associated with it. What is locked with the Exclusive Lock in this case,
please? (it's between "d" and "e" tables below)
psql -U postgres -d ddcKeyGen -c 'select
pg_class.relname,pg_locks.transactionid, pg_locks.mode, pg_locks.granted,
pg_stat_activity.usename,substr(pg_stat_activity.current_query,1,50),
pg_stat_activity.query_start,
age(now(),pg_stat_activity.query_start) as "age", pg_stat_activity.procpid
from pg_stat_activity,pg_locks left
outer join pg_class on (pg_locks.relation = pg_class.oid)
where pg_locks.pid=pg_stat_activity.procpid order by query_start;'
Output:
a_index | | AccessShareLock
| t | user |
| 2011-04-14 17:36:01.257669-07 | 00:21:28.847825 | 16798
b_index | | AccessShareLock
| t | user |
| 2011-04-14 17:36:01.257669-07 | 00:21:28.847825 | 16798
c_index | | AccessShareLock
| t | user |
| 2011-04-14 17:36:01.257669-07 | 00:21:28.847825 | 16798
d | |
AccessShareLock | t | user |
| 2011-04-14 17:36:01.257669-07 |
00:21:28.847825 | 16798
|
| ExclusiveLock | t | user |
| 2011-04-14 17:36:01.257669-07 |
00:21:28.847825 | 16798
e | |
AccessShareLock | t | user |
| 2011-04-14 17:36:01.257669-07 |
00:21:28.847825 | 16798
f_index | | ShareLock
| t | user |
| 2011-04-14 17:36:01.257669-07 | 00:21:28.847825 | 16798
g_index | | AccessShareLock | t
| user | |
2011-04-14 17:36:01.257669-07 | 00:21:28.847825 | 16798
Thanks,
Aleksey
From | Date | Subject | |
---|---|---|---|
Next Message | Basil Bourque | 2011-04-15 01:43:21 | UUID can be written to row when passed as parameter/argument to a PL/pgSQL function. Feature or bug? |
Previous Message | Yang Zhang | 2011-04-15 00:51:21 | Re: Compression |