Re: View pg_stat_activity slow to get up to date

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: View pg_stat_activity slow to get up to date
Date: 2004-11-08 18:07:34
Message-ID: 8918.1099937254@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"D'Arcy J.M. Cain" <darcy(at)druid(dot)net> writes:
> I checked the FAQ and docs but haven't found anything definitive. This
> is my SQL test script:

> SELECT pg_backend_pid();
> SELECT * FROM pg_stat_activity order by procpid;

> When I run psql reading that I find that my backend procpid is not in
> the list. I know that I can see it if I can introduce a little sleep (1
> second) between the connection and the reading of pg_stat_activity.

ISTM that what you have here is a bad substitute for using user locks
(see contrib/userlock/).

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message oozmen 2004-11-08 18:48:55 How to create/initialize/access an execution plan
Previous Message D'Arcy J.M. Cain 2004-11-08 18:06:47 Re: View pg_stat_activity slow to get up to date