Skip site navigation (1) Skip section navigation (2)

Displaying current query - eliminating <IDLE>

From: Rieback Melanie <melanie(at)cs(dot)vu(dot)nl>
To: pgsql-novice(at)postgresql(dot)org
Subject: Displaying current query - eliminating <IDLE>
Date: 2005-10-21 22:28:39
Message-ID: Pine.GSO.4.56.0510220011270.19088@flits.few.vu.nl (view raw or flat)
Thread:
Lists: pgsql-novice
This may come across as an odd question, but here goes..

To see the current query in PostgreSQL, the normal procedure is to type:
SELECT current_query FROM pg_stat_activity;

Now here's my question..    I want PostgreSQL to react sufficiently
quickly that the result says:

              current_query
-------------------------------------------
SELECT current_query FROM pg_stat_activity;
(1 row)

and not:

 current_query
---------------
 <IDLE>
(1 row)

In trying to achieve this behavior, I have taken the following actions:

In postgresql.conf:
stats_start_collector = true
stats_command_string = true
stats_block_level = true
stats_row_level = true
stats_reset_on_server_start = true

I also typed at the console:
\set pgstat_stat_interval 0;

This actually worked once, but since then, PostgreSQL has always reported
<IDLE>.  I've tried changing other environment variables, but with
no luck.  Nothing I've done so far has gotten it to respond consistently
in the quick-responding manner that I want.

Does anyone have any advice on how to achieve this desired behavior
consistantly?  I would be really appreciative if anyone had any tips.

Thanks!!!
Melanie R.

Responses

pgsql-novice by date

Next:From: Michael GlaesemannDate: 2005-10-21 22:37:09
Subject: Re: Database design advice
Previous:From: operationsengineer1Date: 2005-10-21 21:58:37
Subject: Re: Importing data

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group