473,473 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Query to pg_stat_activity

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
1 1959
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jaysonsch | last post by:
Hello! I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the...
3
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says...
1
by: Jaime Casanova | last post by:
Hi all, in the pg_stat_activity catalog there is a field called current_query but it is in blank when i modify the show statement stat in postgresql.conf i win nothing. what am i doing wrong? ...
2
by: Rajesh Kumar Mallah | last post by:
Hi , I noticed that an entry in pg_stat_activity was existing for a long duration > 2 mins while its backend ( process corresponding to that procpid) was not running. how can it be possible ?...
2
by: David Garamond | last post by:
56% ETA ... I know there is no such thing in Postgres right now (though there is pg_stat_activity). But is there database product that can do this? -- dave
5
by: Shanmugasundaram Doraisamy | last post by:
Dear Group, We have a java front-end for postgresql 3.4. When we monitor the system usage using top we find couple of postmasters taking up close to 90% of the CPU time in total. I would like to...
5
by: Anony Mous | last post by:
Coming off of 7.4.3 I've always used select count(*) from pg_stat_activity through the ODBC driver to obtain the number of connections to the db. I've found that with v8.0 Beta 1 that this...
3
by: Jeff Amiel | last post by:
I ran a home-grown self continuous stress test tool against my 7.4.2 database. I banged 'ps' (running freebsd) while it was active and witnessed several of the 'back end' postgres processes...
9
by: Eugeny Balakhonov | last post by:
Hi! How to change query priority dynamically? I have a web site which uses PostgreSQL as a host database and a background program which uses this database too.
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.