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 D3B75533BB for ; Tue, 29 Mar 2005 17:02:52 +0100 (BST) 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 96339-09 for ; Tue, 29 Mar 2005 16:02:48 +0000 (GMT) Received: from koolancexeon.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by svr1.postgresql.org (Postfix) with ESMTP id 56DE552951 for ; Tue, 29 Mar 2005 17:02:47 +0100 (BST) Received: mail.g2switchworks.com 10.10.1.8 from 10.10.1.37 10.10.1.37 via HTTP with MS-WebStorage 6.5.6944 Received: from state.g2switchworks.com by mail.g2switchworks.com; 29 Mar 2005 10:02:42 -0600 Subject: Re: Determine current running query, From: Scott Marlowe To: Adam Witney Cc: Tom Lane , pgsql-admin In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1112112162.22988.32.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 29 Mar 2005 10:02:42 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/465 X-Sequence-Number: 16963 On Tue, 2005-03-29 at 09:50, Adam Witney wrote: > On 29/3/05 4:27 pm, "Tom Lane" wrote: > > > Adam Witney writes: > >> Shouldn't there be something in current_query? > > > > Only if (a) you have stats_command_string turned on, *and* (b) you > > are a superuser or the owner of the target process. > > I am logged in as the superuser, and I just switched stats_command_string > on. Table now looks like this > > bugasbase=# SELECT * from pg_stat_activity ; > datid | datname | procpid | usesysid | usename | current_query | > query_start > ----------+-----------+---------+----------+---------+---------------+------ > -------------------------- > 80573819 | bugasbase | 23197 | 1 | pgsql | | > 29/03/2005 17:03:25.911288 BST > 80573819 | bugasbase | 23195 | 109 | lubrook | | > > I did find a reference on google to the fact that there was/is a max query > size length for this? I think this was for 7.3.5, is this still the case? > Maybe this is the reason it is not showing up (it is quite a large query > string)? You might want to post your reference. There hasn't been a built-in query length limit for quite some time now. MySQL's benchmark, by the way, erroneously listed postgresql as having a 16 meg max query size because (tada!) they had a 16 meg buffer allocated in their benchmark and when it filled up and errored out the size was 16 meg. I don't believe this was ever fixed, either in their code or in the report they had for a very long time on their web site. And it was pointed out again and again, by me.