Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 022EB633F30 for ; Thu, 26 Mar 2009 05:16:23 -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 43719-04 for ; Thu, 26 Mar 2009 05:16:11 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from serv2.oss.ntt.co.jp (serv2.oss.ntt.co.jp [222.151.198.100]) by mail.postgresql.org (Postfix) with ESMTP id 72893635160 for ; Thu, 26 Mar 2009 05:16:15 -0300 (ADT) Received: from serv2.oss.ntt.co.jp (localhost [127.0.0.1]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id 7516C2480C2; Thu, 26 Mar 2009 17:16:11 +0900 (JST) Received: from serv1.oss.ntt.co.jp (serv1.localdomain [172.19.0.2]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id 6432D2480BE; Thu, 26 Mar 2009 17:16:11 +0900 (JST) Received: from [127.0.0.1] (unknown [172.17.1.145]) by serv1.oss.ntt.co.jp (Postfix) with ESMTP id 13980104165; Thu, 26 Mar 2009 17:16:11 +0900 (JST) Message-ID: <49CB39C7.2000008@oss.ntt.co.jp> Date: Thu, 26 Mar 2009 17:16:07 +0900 From: Tatsuhito Kasahara User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Guillaume Smet CC: depesz@depesz.com, pgsql-hackers@postgresql.org Subject: Re: display previous query string of idle-in-transaction References: <49C9F49B.8020003@oss.ntt.co.jp> <20090325164859.GB30902@depesz.com> <1d4e0c10903251007v500e762bqd3514a0c440b928c@mail.gmail.com> In-Reply-To: <1d4e0c10903251007v500e762bqd3514a0c440b928c@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/1035 X-Sequence-Number: 135713 Guillaume Smet wrote: > On Wed, Mar 25, 2009 at 5:48 PM, hubert depesz lubaczewski > wrote: >> I would love to get it, but when I suggested it some time in the past >> Tom shot it down as bad idea. >> >> http://archives.postgresql.org/message-id/20071016132131.GA4438@depesz.com > > I agree with Tom here. I tracked a lot of idle in transaction problems > and you need the whole sequence of queries of all the backends to > really understand what happens. > The last query executed is mostly useless to solve this sort of > problem. At least, it was for me in every case I had to deal with. I think so too. But last-query-string may be a useful *hint*. It is a hard work to trace the whole sequence of queries. In most cases, last query string is enough information to solve the long transaction problem. And I want a easy way to get the informarion. # last query string is also a key to trace queries. "COMMIT;BEGIN;idle in transaction" is not a problem on 8.3 or later, but "(BEGIN;)SOME SQL;idle in transaction" is a problem. So, main purpose of displaying the last query string is .. - check whether "idle in transaction (running long time) process after SOME SQL" is exists or not. - check the content of "SOME SQL". best regards, -- Tatsuhito Kasahara kasahara.tatsuhito@oss.ntt.co.jp