Re: SELECT .. FOR UPDATE: find out who locked a row

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: SELECT .. FOR UPDATE: find out who locked a row
Дата
Msg-id CANu8FiyPd5DUuP01RKjmYzxZcBFaPFfV6qZeiEzQJU5QAfx2jg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: SELECT .. FOR UPDATE: find out who locked a row  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: SELECT .. FOR UPDATE: find out who locked a row
Re: SELECT .. FOR UPDATE: find out who locked a row
Список pgsql-general

>I guess with your query I can figure out which connection holds a lock, but it seems I cannot correlate those locks to the rows which actually are locked, since pg_locks seems not to reference this in any way.

Enrico,

FWIW, I really don't understand your need to identify the actual rows that are locked. Once you have identified the query that is causing a block (which is usually
due to "Idle in Transaction"), AFAIK the only way to remedy the problem is to kill the offending query, or wait for it to complete. I am not aware of any way available
to a user to "unlock" individual rows". Indeed, if you could, it would probably lead to corruption of some form.

BTW, the query I provided WILL work in version 10.  The commented section was for v9.1 and prior, as "someone" felt it necessary to rename some fields in pg_stat_activity
and remove/replace another field. Hopefully they will refrain from doing so in the future, as it breaks queries and applications.

--
Melvin Davidson
Maj. Database & Exploration Specialist

Universe Exploration Command – UXC

Employment by invitation only!

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Want to disable fully qualified table names on pg_dump in pg_dump(PostgreSQL) 9.6.8
Следующее
От: chiru r
Дата:
Сообщение: Re: PgBackrest questions