current_query='IDLE" in pg_stat_activity

Started by paramjib baruahover 10 years ago3 messagesgeneral
Jump to latest
#1paramjib baruah
paramjibbaruah@gmail.com

Hi ,

I am trying to check current running sql queries in postgres through
pg_stat_activity .However, in the current_query column I could see only
"IDLE" . I am not able to see the query .

Thanks
Paramjib Baruah

#2Chris Withers
chris@simplistix.co.uk
In reply to: paramjib baruah (#1)
Re: current_query='IDLE" in pg_stat_activity

On 23/11/2015 10:33, paramjib baruah wrote:

I am trying to check current running sql queries in postgres through
pg_stat_activity .However, in the current_query column I could see
only "IDLE" . I am not able to see the query .

That would suggest no query is running, what suggests to you that there
are queries you should be expecting to see?

cheers,

Chris

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Melvin Davidson
melvin6925@gmail.com
In reply to: Chris Withers (#2)
Re: current_query='IDLE" in pg_stat_activity

You have not specified your O/S or PostgreSQL version, but if you are
running on a Linux O/S, you can run the attached current_queries.sh, which
loops every 5 seconds by default.
Note the usage options below:
usage() {
echo "Usage: $0 [-s <sleeptime> -d <dbname> -h <host> -U <user> -p
<port> -x -i]"
echo "-x will exit after 1 iteration"
echo "-i will exclude <IDLE> queries"
exit 1
}

On Mon, Nov 23, 2015 at 5:42 AM, Chris Withers <chris@simplistix.co.uk>
wrote:

On 23/11/2015 10:33, paramjib baruah wrote:

I am trying to check current running sql queries in postgres through
pg_stat_activity .However, in the current_query column I could see only
"IDLE" . I am not able to see the query .

That would suggest no query is running, what suggests to you that there
are queries you should be expecting to see?

cheers,

Chris

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

Attachments:

current_queries.shapplication/x-sh; name=current_queries.shDownload