Re: is pg_stat_activity "transactional"? How fast does it update?

Поиск
Список
Период
Сортировка
От Dominique Devienne
Тема Re: is pg_stat_activity "transactional"? How fast does it update?
Дата
Msg-id CAFCRh-8twaDLV2uEy=R8e7U29LOAPhRN8vVzq712UE_J=7Ld4w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: is pg_stat_activity "transactional"? How fast does it update?  (Dominique Devienne <ddevienne@gmail.com>)
Список pgsql-general
On Tue, Jun 10, 2025 at 5:46 PM Dominique Devienne <ddevienne@gmail.com> wrote:
> On Tue, Jun 10, 2025 at 4:27 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > PQfinish is asynchronous: [...]
> > [...] pg_stat_activity() takes a snapshot of the view's contents
> Many thanks Tom. Didn't know either of those facts.

Hi. I ended up polling pg_stat_activity to wait for the disappearance
of the backend, to avoid the race in my unit tests. Initially
pg_stat_clear_snapshot() seemed to help, but then it didn't. Not
ideal, but I don't see any solution (work-around, really). There's a
new LOGIN event trigger, but no symmetrical FINISH one, and those are
restricted to privileged users, so useless in my case. Oh well. --DD



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