pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feed'show full processlist' in postgres?
6+ messages / 4 participants
[nested] [flat]
* 'show full processlist' in postgres?
@ 2005-07-01 13:58 Erik Wasser <erik.wasser@iquer.net>
2005-07-01 16:24 ` Re: 'show full processlist' in postgres? Jim Buttafuoco <jim@contactbda.com>
0 siblings, 1 reply; 6+ messages in thread
From: Erik Wasser @ 2005-07-01 13:58 UTC (permalink / raw)
To: pgsql-sql
Hallo pgsql-sql@postgresql.org,
I'm looking for a way to display the active querys of postgres. The
mysql way is a 'show [full] processlist'.
After I've read http://pgsqld.active-venture.com/monitoring-stats.html I
set STATS_COMMAND_STRING, STATS_BLOCK_LEVEL, STATS_ROW_LEVEL and
STATS_START_COLLECTOR to 'true'.
Then I executed the query from the bottom of the page:
> SELECT pg_stat_get_backend_pid(S.backendid) AS procpid,
> pg_stat_get_backend_activity(S.backendid) AS current_query
> FROM (SELECT pg_stat_get_backend_idset() AS backendid) AS S;
The result was:
procpid | current_query
---------+---------------
1367 |
27387 |
930 |
28425 | <IDLE>
(4 rows)
Why there isn't any query in the 'current_query' row? Calling the query
multiple times just changes the PID (sometimes) but 'current_query' was
always empty. How do I show up the a list of querys that will be
processed right in this moment?
P.S: I'm using postgresql 7.4.7 and I was logged I as 'postgres'.
--
So long... Fuzz
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: 'show full processlist' in postgres?
2005-07-01 13:58 'show full processlist' in postgres? Erik Wasser <erik.wasser@iquer.net>
@ 2005-07-01 16:24 ` Jim Buttafuoco <jim@contactbda.com>
2005-07-01 17:13 ` Re: 'show full processlist' in postgres? Erik Wasser <erik.wasser@iquer.net>
0 siblings, 1 reply; 6+ messages in thread
From: Jim Buttafuoco @ 2005-07-01 16:24 UTC (permalink / raw)
To: Erik Wasser <erik.wasser@iquer.net>; pgsql-sql
did you restart postgresql and use the pg_stat_activity view instead (just to save some typing).
Jim
---------- Original Message -----------
From: Erik Wasser <erik.wasser@iquer.net>
To: pgsql-sql@postgresql.org
Sent: Fri, 1 Jul 2005 15:58:46 +0200
Subject: [SQL] 'show full processlist' in postgres?
> Hallo pgsql-sql@postgresql.org,
>
> I'm looking for a way to display the active querys of postgres. The
> mysql way is a 'show [full] processlist'.
>
> After I've read http://pgsqld.active-venture.com/monitoring-stats.html I
> set STATS_COMMAND_STRING, STATS_BLOCK_LEVEL, STATS_ROW_LEVEL and
> STATS_START_COLLECTOR to 'true'.
>
> Then I executed the query from the bottom of the page:
>
> > SELECT pg_stat_get_backend_pid(S.backendid) AS procpid,
> > pg_stat_get_backend_activity(S.backendid) AS current_query
> > FROM (SELECT pg_stat_get_backend_idset() AS backendid) AS S;
>
> The result was:
>
> procpid | current_query
> ---------+---------------
> 1367 |
> 27387 |
> 930 |
> 28425 | <IDLE>
> (4 rows)
>
> Why there isn't any query in the 'current_query' row? Calling the query
> multiple times just changes the PID (sometimes) but 'current_query' was
> always empty. How do I show up the a list of querys that will be
> processed right in this moment?
>
> P.S: I'm using postgresql 7.4.7 and I was logged I as 'postgres'.
>
> --
> So long... Fuzz
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
------- End of Original Message -------
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: 'show full processlist' in postgres?
2005-07-01 13:58 'show full processlist' in postgres? Erik Wasser <erik.wasser@iquer.net>
2005-07-01 16:24 ` Re: 'show full processlist' in postgres? Jim Buttafuoco <jim@contactbda.com>
@ 2005-07-01 17:13 ` Erik Wasser <erik.wasser@iquer.net>
2005-07-01 19:42 ` Re: 'show full processlist' in postgres? Tom Lane <tgl@sss.pgh.pa.us>
2005-07-01 20:19 ` Re: [despammed] Re: 'show full processlist' in postgres? Andreas Kretschmer <akretschmer@despammed.com>
0 siblings, 2 replies; 6+ messages in thread
From: Erik Wasser @ 2005-07-01 17:13 UTC (permalink / raw)
To: pgsql-sql
On Friday 01 July 2005 18:24, Jim Buttafuoco wrote:
> did you restart postgresql and use the pg_stat_activity view instead
> (just to save some typing).
No. Is a restart necessary or will a 'reload' do also the trick?
I've done the restart:
postgres=# SELECT * from pg_stat_activity ;
datid | datname | procpid | usesysid | usename | current_query |
query_start
---------+-----------+---------+----------+-----------+---------------+-------------
7349453 | admintool | 5436 | 100 | admintool | |
7349454 | postgres | 5437 | 1 | postgres | |
(2 rows)
But 'current_query' is still always empty... B-(
--
So long... Fuzz
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: 'show full processlist' in postgres?
2005-07-01 13:58 'show full processlist' in postgres? Erik Wasser <erik.wasser@iquer.net>
2005-07-01 16:24 ` Re: 'show full processlist' in postgres? Jim Buttafuoco <jim@contactbda.com>
2005-07-01 17:13 ` Re: 'show full processlist' in postgres? Erik Wasser <erik.wasser@iquer.net>
@ 2005-07-01 19:42 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 6+ messages in thread
From: Tom Lane @ 2005-07-01 19:42 UTC (permalink / raw)
To: Erik Wasser <erik.wasser@iquer.net>; +Cc: pgsql-sql
Erik Wasser <erik.wasser@iquer.net> writes:
> But 'current_query' is still always empty... B-(
The pg_stats views lag reality by a certain amount, so checking for your
own query is generally not gonna work. Try starting a long-running
query in another session.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [despammed] Re: 'show full processlist' in postgres?
2005-07-01 13:58 'show full processlist' in postgres? Erik Wasser <erik.wasser@iquer.net>
2005-07-01 16:24 ` Re: 'show full processlist' in postgres? Jim Buttafuoco <jim@contactbda.com>
2005-07-01 17:13 ` Re: 'show full processlist' in postgres? Erik Wasser <erik.wasser@iquer.net>
@ 2005-07-01 20:19 ` Andreas Kretschmer <akretschmer@despammed.com>
2005-07-20 15:48 ` Re: [despammed] Re: 'show full processlist' in postgres? Erik Wasser <erik.wasser@iquer.net>
1 sibling, 1 reply; 6+ messages in thread
From: Andreas Kretschmer @ 2005-07-01 20:19 UTC (permalink / raw)
To: pgsql-sql
am 01.07.2005, um 19:13:36 +0200 mailte Erik Wasser folgendes:
> postgres=# SELECT * from pg_stat_activity ;
> datid | datname | procpid | usesysid | usename | current_query |
> query_start
> ---------+-----------+---------+----------+-----------+---------------+-------------
> 7349453 | admintool | 5436 | 100 | admintool | |
> 7349454 | postgres | 5437 | 1 | postgres | |
> (2 rows)
>
> But 'current_query' is still always empty... B-(
enable stats_command_string in your postgresql.conf
Regards, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [despammed] Re: 'show full processlist' in postgres?
2005-07-01 13:58 'show full processlist' in postgres? Erik Wasser <erik.wasser@iquer.net>
2005-07-01 16:24 ` Re: 'show full processlist' in postgres? Jim Buttafuoco <jim@contactbda.com>
2005-07-01 17:13 ` Re: 'show full processlist' in postgres? Erik Wasser <erik.wasser@iquer.net>
2005-07-01 20:19 ` Re: [despammed] Re: 'show full processlist' in postgres? Andreas Kretschmer <akretschmer@despammed.com>
@ 2005-07-20 15:48 ` Erik Wasser <erik.wasser@iquer.net>
0 siblings, 0 replies; 6+ messages in thread
From: Erik Wasser @ 2005-07-20 15:48 UTC (permalink / raw)
To: pgsql-sql
On Friday 01 July 2005 22:19, Andreas Kretschmer wrote:
> enable stats_command_string in your postgresql.conf
That was missing. Thanks.
--
So long... Fuzz
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2005-07-20 15:48 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-01 13:58 'show full processlist' in postgres? Erik Wasser <erik.wasser@iquer.net>
2005-07-01 16:24 ` Jim Buttafuoco <jim@contactbda.com>
2005-07-01 17:13 ` Erik Wasser <erik.wasser@iquer.net>
2005-07-01 19:42 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-07-01 20:19 ` Andreas Kretschmer <akretschmer@despammed.com>
2005-07-20 15:48 ` Erik Wasser <erik.wasser@iquer.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox