X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 64382D1D15D for ; Wed, 20 Aug 2003 06:58:04 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 90866-09 for ; Wed, 20 Aug 2003 06:57:54 -0300 (ADT) Received: from mail.psychofx.com (unknown [217.71.230.39]) by svr1.postgresql.org (Postfix) with ESMTP id D6085D1D125 for ; Wed, 20 Aug 2003 06:57:50 -0300 (ADT) Received: by mail.psychofx.com (Postfix, from userid 10002) id A23482403B; Wed, 20 Aug 2003 10:57:17 +0100 (BST) Received: from psychofx.com (unknown [217.71.230.212]) by mail.psychofx.com (Postfix) with ESMTP id E2401237B3; Wed, 20 Aug 2003 10:57:12 +0100 (BST) Message-ID: <3F434543.4040104@psychofx.com> Date: Wed, 20 Aug 2003 10:54:11 +0100 From: Chris Miles Organization: chrismiles.info User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ramil Sagum Cc: pgsql-admin@postgresql.org, Chris Miles Subject: Re: get current queries References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/237 X-Sequence-Number: 9958 There is a simple way to get this all from psql. First edit postgresql.conf and make sure: stats_command_string = true (and restart or HUP postmaster if necessary) Then connect to your database and use my favorite query: SELECT datname,procpid,current_query FROM pg_stat_activity ORDER BY procpid; which will give you database name, pid and current query (or ) for each current connection to the database. Note that you will see queries for all databases, not just the one you connected to. This is what I use for 7.1, I don't know if it differs for newer versions. Cheers, CM -- Chris Miles http://chrismiles.info/ Ramil Sagum wrote: > > is there any way to see what statements/queries are currently being passed > on to the database? > > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings