Query to pg_stat_activity

From: Carmen Gloria Sepulveda Dedes <csepulveda(at)atichile(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Query to pg_stat_activity
Date: 2003-11-03 21:08:56
Message-ID: 3FA6C3E8.AD1890C1@atichile.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello.

I want to query pg_stat_activity to see the current_query field. I do:

mdbs=# select current_user;
current_user
--------------
postgres
(1 row)

mdbs=# select * from pg_stat_activity;
datid | datname | procpid | usesysid | usename | current_query
-------+---------+---------+----------+----------------+---------------
16976 | mdbs | 8537 | 121 | mdbs_app_owner |
16976 | mdbs | 12378 | 121 | mdbs_app_owner |
16976 | mdbs | 14375 | 1 | postgres |
16976 | mdbs | 14337 | 121 | mdbs_app_owner |

but, "current_query" is null. Why?

Thanks.

CG

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-11-03 21:19:27 Re: Query to pg_stat_activity
Previous Message Manfred Koizar 2003-11-03 20:45:08 Re: Help on update that subselects other records in table, uses joins