Thread: waiting column in pg_stat_activity and function pg_stat_get_backend_waiting (8.1)

In 8.2, pg_stat_activity has a column called waiting, which is achieved
through a function called pg_stat_get_backend_waiting.

However, in 8.1, this column does not exist in pg_stat_activity. Is it
possible to get this column / data in 8.1? I see from
http://www.postgresql.org/docs/8.1/static/monitoring-stats.html
that such a function is not available.

On Wed, 2010-03-10 at 13:38 -0500, Carol Cheung wrote:
> In 8.2, pg_stat_activity has a column called waiting, which is achieved
> through a function called pg_stat_get_backend_waiting.
>
> However, in 8.1, this column does not exist in pg_stat_activity. Is it
> possible to get this column / data in 8.1? I see from
> http://www.postgresql.org/docs/8.1/static/monitoring-stats.html
> that such a function is not available.

You can look at pg_locks for ungranted locks.   You can join back to
pg_stat_activity on the pid.

--
Brad Nicholson  416-673-4106
Database Administrator, Afilias Canada Corp.