Re: Too many IDLE in current_query - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: Too many IDLE in current_query
Date
Msg-id 4E1C2A4C020000250003F23C@gw.wicourts.gov
Whole thread Raw
In response to Too many IDLE in current_query  ("francescoboccacci@libero.it" <francescoboccacci@libero.it>)
List pgsql-admin
"francescoboccacci@libero.it" <francescoboccacci@libero.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

pgsql-admin by date:

Previous
From: "francescoboccacci@libero.it"
Date:
Subject: R: Too many IDLE in current_query
Next
From: "Kevin Grittner"
Date:
Subject: Re: R: Too many IDLE in current_query