Re: view row-level locks

Поиск
Список
Период
Сортировка
От Vivek Khera
Тема Re: view row-level locks
Дата
Msg-id FCD1881E-A6E1-4669-8BE6-D4BCCC0E7A8F@khera.org
обсуждение исходный текст
Ответ на Re: view row-level locks  (Richard Huxton <dev@archonet.com>)
Ответы Re: view row-level locks  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Jul 11, 2008, at 4:24 AM, Richard Huxton wrote:

> If you just want to see if a lock has been taken (e.g. SELECT FOR
> UPDATE) then that shows in pg_locks. If you want details on the
> actual rows involved, then you probably want "pgrowlocks" mentioned
> in Appendix F. Additional Supplied Modules.

pg_locks tells you the page/tuple so you can select it with those
values.  Assuming they are page=132 and tuple=44 and relation=99 you
can find the tuple thusly:

select relname from pg_class where oid=99;

then given that relname=mytable,

select * from mytable where ctid='(132,44)';

and there you have the row.

What I need to see is which locks my other queries are waiting on.  If
pg_locks would show me which process is also blocking on this lock,
I'd be a much happier man today (actually, last tuesday, when this was
a problem for me to debug something).


В списке pgsql-general по дате отправления:

Предыдущее
От: Augustin Amann
Дата:
Сообщение: Re: Update / Lock (and ShareLock) question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Update / Lock (and ShareLock) question