Re: Finding if old transactions are running...
| От | Tom Lane |
|---|---|
| Тема | Re: Finding if old transactions are running... |
| Дата | |
| Msg-id | 1989.1109313060@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Finding if old transactions are running... (jtv@xs4all.nl) |
| Ответы |
Re: Finding if old transactions are running...
|
| Список | pgsql-hackers |
jtv@xs4all.nl writes:
> Tom, I believe you said at the time that I should check pg_stat_activity.
> My current code polls it for the old backend pid. But if that is neither
> 100% reliable nor unconditionally available, wouldn't it be better if I
> just queried pg_locks for the transaction's ID? Would that work for all
> backend versions I can expect to see?
pg_locks certainly seems like a better solution. Perhaps it didn't
exist when you went with pg_stat_activity? Can't recall offhand.
Note that you still want to look for your old backend's PID; it seems
impractically expensive to keep track of the current transaction's XID.
(At a minimum that would cost another query per xact...)
regards, tom lane
В списке pgsql-hackers по дате отправления: