pg_locks view versus prepared transactions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pg_locks view versus prepared transactions
Дата
Msg-id 13967.1119109760@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
Now that Heikki's two-phase-commit patch is in, we have a bit of a
problem in the pg_locks view: prepared transactions can hold locks,
but you can't tell which prepared transaction is holding which lock.
They all show with "pid 0".  (This should probably come out as a NULL
instead of 0, but I didn't change it yet.)

I think the minimum thing we ought to do about this is add an XID
column to pg_locks to show the transaction ID holding each lock.
Then you could join that to pg_prepared_xacts to see what's what.

I was also wondering about adding a current-XID column to
pg_stat_activity, and encouraging people to join pg_locks and
pg_stat_activity on XID instead of PID.

Ultimately we should maybe even remove PID from pg_locks, but probably
for backwards compatibility it'd have to be deprecated for a release
or two first.

Thoughts?
        regards, tom lane


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

Предыдущее
От: Tino Wildenhain
Дата:
Сообщение: Re: process crash when a plpython function returns
Следующее
От: Juan Pablo Espino
Дата:
Сообщение: Login/logout