Обсуждение: How to use pg_stat_activity correctly ?

Поиск
Список
Период
Сортировка

How to use pg_stat_activity correctly ?

От
Luki Rustianto
Дата:
Hi All,

I try to query on pg_stat_activity but the returned result is only like this:

teramedv2=> select * from pg_stat_activity where datname='teramedv2';
 datid |  datname  | procpid | usesysid | usename | current_query | query_start
-------+-----------+---------+----------+---------+---------------+-------------
 17178 | teramedv2 |   32727 |      103 | test    |               |
 17178 | teramedv2 |   26848 |      103 | test    |               |
 17178 | teramedv2 |     563 |      103 | test    |               |
 17178 | teramedv2 |   26799 |      103 | test    |               |
(4 rows)

the field current_query and query_start seems to me always null ... I
try to do a long run select query on the other console and see the
returned result from pg_stat_activity but the returned result is only
new row with datid,datname,procpid,usename fields is filled with the
correct value but current_query and query_start fields is always null.
Is this an expected result ?

Re: How to use pg_stat_activity correctly ?

От
"A. Kretschmer"
Дата:
am  10.02.2006, um 15:30:02 +0700 mailte Luki Rustianto folgendes:
> Hi All,
>
> I try to query on pg_stat_activity but the returned result is only like this:
>
> teramedv2=> select * from pg_stat_activity where datname='teramedv2';
>  datid |  datname  | procpid | usesysid | usename | current_query | query_start
> -------+-----------+---------+----------+---------+---------------+-------------
>  17178 | teramedv2 |   32727 |      103 | test    |               |
>  17178 | teramedv2 |   26848 |      103 | test    |               |
>  17178 | teramedv2 |     563 |      103 | test    |               |
>  17178 | teramedv2 |   26799 |      103 | test    |               |
> (4 rows)
>
> the field current_query and query_start seems to me always null ... I

stats_command_string = on
(postgresql.conf)


HTH, Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47215,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===