Re: where is pg_stat_activity (and others) in the documentation?

From: Scott Mead <scott(at)scottrmead(dot)com>
To: Vick Khera <vivek(at)khera(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: where is pg_stat_activity (and others) in the documentation?
Date: 2010-11-16 14:05:47
Message-ID: AANLkTikoqQ_XENNxKOsVhmWSsdcMbTb+DqVH+NtyXXuj@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 15, 2010 at 10:03 AM, Vick Khera <vivek(at)khera(dot)org> wrote:

> On Mon, Nov 15, 2010 at 5:15 AM, Willy-Bas Loos <willybas(at)gmail(dot)com>
> wrote:
> > I was looking for what exactly "waiting" means in pg_stat_activity.
>

You can find out exactly what you're waiting for by correlating this to the
pg_locks table.

Grab the 'procpid' of your waiting query and run:

select * from pg_locks where pid=<thepid> and granted='f';

Notice, in the pg_locks table, the logic works slightly different... if
you're 'waiting' (pg_stat_activity), then you haven't been 'granted'
(pg_locks).

As far as documentation:
http://www.postgresql.org/docs/current/static/monitoring-stats.html

--Scott

>
> waiting for a lock.
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-11-16 15:40:08 Re: Postgres forums ... take 2
Previous Message Elliot Chance 2010-11-16 12:43:20 Re: Postgres forums ... take 2