X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 085C75287F for ; Fri, 1 Jul 2005 10:58:55 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 06624-07 for ; Fri, 1 Jul 2005 13:58:47 +0000 (GMT) Received: from sponts0.iquer.net (mx0.iquer.net [195.234.230.66]) by svr1.postgresql.org (Postfix) with SMTP id 94C10529DE for ; Fri, 1 Jul 2005 10:58:45 -0300 (ADT) Received: from smtp.iquer.net (sv8.int.iquer.net [10.0.11.80]) by sponts0.iquer.net (SPONTS v2.0.23) with ESMTP id 104D2B13A5D-0 for ; Fri, 1 Jul 2005 13:58:47 +0000 Received: from ws1.int.iquer.net (ws1.int.iquer.net [10.0.16.220]) by smtp.iquer.net (Postfix) with ESMTP id 110CD10AE7F for ; Fri, 1 Jul 2005 15:58:47 +0200 (CEST) From: Erik Wasser To: pgsql-sql@postgresql.org Subject: 'show full processlist' in postgres? Date: Fri, 1 Jul 2005 15:58:46 +0200 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507011558.46408.erik.wasser@iquer.net> X-SPONTS-Version: 2.0.23 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200507/3 X-Sequence-Number: 21981 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 | (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