X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7492A5288A for ; Tue, 16 Aug 2005 01:07:42 -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 86282-07 for ; Tue, 16 Aug 2005 04:07:41 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.193]) by svr1.postgresql.org (Postfix) with ESMTP id BD1F2528C0 for ; Tue, 16 Aug 2005 01:07:40 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 49so13400wri for ; Mon, 15 Aug 2005 21:07:40 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sfDwDeEtmp6EaINae0UwFdPaku1XVFBO8EX5r4vxrS75cCaNx7ZzMlglxgHCmIGC962fOi88yRK1dlQpuRzCknqsRhbyEzhxB/MM71qiJQL+ZfJyvBC9pCFOD/YmG3dFMozynvs5xbZJkKU89M1yDWmrJddGy/ob01/zRS8tJtY= Received: by 10.54.55.19 with SMTP id d19mr115029wra; Mon, 15 Aug 2005 21:07:40 -0700 (PDT) Received: by 10.54.17.41 with HTTP; Mon, 15 Aug 2005 21:07:40 -0700 (PDT) Message-ID: <1c66bda80508152107a29330e@mail.gmail.com> Date: Tue, 16 Aug 2005 16:07:40 +1200 From: adey To: Chris Hoover Subject: Re: Any way to see what queries are currently running? Cc: pgsql-admin@postgresql.org In-Reply-To: <1d219a6f05081513546f6458b6@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1d219a6f05081513546f6458b6@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.54 required=5 tests=[FROM_ENDS_IN_NUMS=0.516, RCVD_BY_IP=0.024] X-Spam-Level: X-Archive-Number: 200508/188 X-Sequence-Number: 18507 You could try the following query after enabling the stats_command_string parameter in the postgresql.conf file:- -- displays current activity in the database -- postgresql.conf parameter stats_command_string populates the current_query -- column select =09datid,=20 =09datname as "DB Name",=20 =09substr(procpid,1,6) as "Procpid",=20 =09substr(usesysid,1,5),=20 =09usename,=20 =09current_query as SQL,=20 =09query_start from=20 =09pg_stat_activity order by=20 =09procpid On 8/16/05, Chris Hoover wrote: > I'm running 7.3.4. Is there anyway to see the actual sql being run by > the database via a query? I am having some problems with long running > load causing querires from our reporting system. I have sql logging > turned on to log the sql statements to my postgres.log file. However, > these reporting queries do not appear to be logging the entire query. > I am only getting the select clause (and I'm not sure if it's all of > it) but no from or where clause. >=20 > Can I pull these queries out from postgres? >=20 > Thanks, >=20 > Chris >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings >