Re: Too many IDLE in current_query

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "francescoboccacci(at)libero(dot)it" <francescoboccacci(at)libero(dot)it>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Too many IDLE in current_query
Date: 2011-07-12 16:04:44
Message-ID: 4E1C2A4C020000250003F23C@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"francescoboccacci(at)libero(dot)it" <francescoboccacci(at)libero(dot)it> wrote:

> i'm checking my postgresql server to try to monitoring all
> activity that are running.
> i run this query:
>
> postgres=# select
> current_timestamp - query_start as runtime,
> current_query
> from pg_stat_activity
> order by 1 desc;

> The strange thing is that there are quesries that are running from
> 34 days.I think is strange.

query_start is the last time a query started; it doesn't indicate
that it's still running. In fact <IDLE> means it isn't. You should
probably exclude rows where xact_start is null or where
current_query = '<IDLE>'.

-Kevin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2011-07-12 16:07:16 Re: R: Too many IDLE in current_query
Previous Message francescoboccacci@libero.it 2011-07-12 16:03:55 R: Too many IDLE in current_query