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

Re: pg_stat_activity versus ps

From: Jeff Amiel <jamiel(at)istreamimaging(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_stat_activity versus ps
Date: 2004-08-24 14:56:54
Message-ID: 412B5736.7040905@istreamimaging.com (view raw)
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 exeucting queries, commits, 
inserts, etc....(the actual work the processes were doing was listed in 
the 'ps' output)
however, if I checked pg_stat_activity during the same time period, I 
saw nothing populated in the current_query column...ever.

Am I misunderstanding what the pg_stat_activity table is for?  I 
confirmed that the procpid listed in pg_stat_activity was the same as 
listed in my 'ps' process list....


Jeff

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Amiel <jamiel(at)istreamimaging(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_stat_activity versus ps
Date: 2004-08-24 16:43:44
Message-ID: 4964.1093365824@sss.pgh.pa.us (view raw)
Jeff Amiel <jamiel(at)istreamimaging(dot)com> writes:
> however, if I checked pg_stat_activity during the same time period, I 
> saw nothing populated in the current_query column...ever.

Did you have it turned on?  (stats_command_string config parameter)

Were you checking as superuser?

			regards, tom lane

From: Jeff Amiel <jamiel(at)istreamimaging(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_stat_activity versus ps
Date: 2004-08-24 17:08:03
Message-ID: 412B75F3.5040101@istreamimaging.com (view raw)
That was it. (not having it turned on.  duh).
Guess I should have read  section 23.2 of the docs..."The Statistics 
Collector"
Thanks for the heads up.

Jeff


Tom Lane wrote:

>Jeff Amiel <jamiel(at)istreamimaging(dot)com> writes:
>  
>
>>however, if I checked pg_stat_activity during the same time period, I 
>>saw nothing populated in the current_query column...ever.
>>    
>>
>
>Did you have it turned on?  (stats_command_string config parameter)
>
>Were you checking as superuser?
>
>			regards, tom lane
>
>
>  
>


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jeff Amiel <jamiel(at)istreamimaging(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_stat_activity versus ps
Date: 2004-08-26 03:12:32
Message-ID: 200408260312.i7Q3CWQ01948@candle.pha.pa.us (view raw)
Jeff Amiel wrote:
> That was it. (not having it turned on.  duh).
> Guess I should have read  section 23.2 of the docs..."The Statistics 
> Collector"

8.0 will give clear output showing it is not turned on our you don't
have permissions.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073


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