Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id AB84B63307B for ; Thu, 4 Jun 2009 23:22:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 44686-07 for ; Thu, 4 Jun 2009 23:22:35 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f211.google.com (mail-bw0-f211.google.com [209.85.218.211]) by mail.postgresql.org (Postfix) with ESMTP id 4338B633051 for ; Thu, 4 Jun 2009 23:22:43 -0300 (ADT) Received: by bwz7 with SMTP id 7so1202637bwz.19 for ; Thu, 04 Jun 2009 19:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=BLLhLnoCguFgg19v197O2QRX/AF45l/LlCsh/XKfycA=; b=T8uzECU8Mqk64hU3P37RL+xTUw2rG9O7kAwZtaXbvzPNTX9eR9IARKxHaj+BqPyq5+ CmBRYaztZ5PzIsYvOYqSWjx5FVn6RYHiHc5M4BDa2O7kdhzwkwQsv4pUrLqyXGka3Q+0 glj+0sOo9XXqMCC7y6mBBsXwUbFrPxLNsvl3Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=OVodtN9lZgaHtiY1t1c9SW9ivUSY+CNd8evJahVqkyrmFZGy7txYPMtFGt5pYAjDg/ VfYYmyLUCtcxCVeIeVkzVjTgu/Q+Ryg8q3lpegQlDgp9r0TjNMlzX+smdrX5Y7NfKRet fFXocAigNrvAR93N3N25Zvozp336SSy78HwB4= MIME-Version: 1.0 Received: by 10.204.53.72 with SMTP id l8mr2633054bkg.171.1244168561833; Thu, 04 Jun 2009 19:22:41 -0700 (PDT) In-Reply-To: <4A287AF3.9000301@oss.ntt.co.jp> References: <49C9F49B.8020003@oss.ntt.co.jp> <1238091273.16568.530.camel@ebony.2ndQuadrant> <49CC75E3.7010101@oss.ntt.co.jp> <1238139418.16568.555.camel@ebony.2ndQuadrant> <4136ffa0906030724g72a56165s33819f3060002dcb@mail.gmail.com> <4A264377.EE98.0025.1@wicourts.gov> <4A287AF3.9000301@oss.ntt.co.jp> Date: Thu, 4 Jun 2009 22:22:41 -0400 Message-ID: <603c8f070906041922u7eaf0f76l8c2b7cbd3049c69b@mail.gmail.com> Subject: Re: display previous query string of idle-in-transaction From: Robert Haas To: Tatsuhito Kasahara Cc: Kevin Grittner , Greg Stark , Asko Oja , Simon Riggs , decibel , pgsql-hackers@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.129 tagged_above=0 required=5 tests=AWL=0.129 X-Spam-Level: X-Archive-Number: 200906/446 X-Sequence-Number: 139501 On Thu, Jun 4, 2009 at 9:54 PM, Tatsuhito Kasahara wrote: > Kevin Grittner wrote: >> >> Greg Stark wrote: >>> >>> Should this patch be on the commitfest page for 8.5? Or is there a >>> consensus already that it's a bad idea? >>> >>> Personally I actually think this makes a lot of sense to do. >> >> =A0+1 >> =A0It at least gives one a reasonable chance to get a useful clue.... > > +1 > # And I'm going to register this patch on the next commitfest page. I don't actually remember seeing actual code to implement this - is this a patch, or just an idea? (I guess if this gets added to the CommitFest page there will be a pointer to the code, but somehow I can't find it at the moment.) The only thing I don't like about this is that I think it's kind of a hack to shove the in transaction designation and the query string into the same database column. I've never liked having to write: select sum(1) from pg_stat_activity where current_query =3D ' in transaction'; ...and I like it even less if I now have to modify that query to use "like". We should find some way to represent this as structured data... maybe make a separate column called "idle" that's a boolean, or something, and let the query column contain the most recent query (whether or not it's still executing). ...Robert