By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,372 Members | 1,906 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,372 IT Pros & Developers. It's quick & easy.

Query to pg_stat_activity

P: n/a
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
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Carmen Gloria Sepulveda Dedes <cs********@atichile.com> writes:
but, "current_query" is null. Why?


Most likely, you haven't enabled gathering of command line statistics.
See postgresql.conf.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.