Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 9D0DF632388 for ; Fri, 27 Mar 2009 08:54:54 -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 42460-03 for ; Fri, 27 Mar 2009 08:54:45 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f169.google.com (mail-bw0-f169.google.com [209.85.218.169]) by mail.postgresql.org (Postfix) with ESMTP id B4B5E6318F3 for ; Fri, 27 Mar 2009 08:54:47 -0300 (ADT) Received: by bwz17 with SMTP id 17so1491281bwz.19 for ; Fri, 27 Mar 2009 04:54:45 -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=yAQFzCtzkXnvZVGTSVfdCtPoGv8rPHrbVaLX8G39Zkc=; b=glrVZx9KWi271aNYXdS6SpihAmxvAyQlH1/eTwA4F2n1DWS8AaUgyS+BheESmr5LKT fVtjvwnKiPk+6UJK7wYbuVt/GGuwchWe7k/ptBRhfANpHOl9kXzo2T0E8CdZ/PBr9hK7 BKHA55w21dqbHsooF5vIYN35m23uH8pDeVwxk= 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=HFFBqsPaKbZOWroB79K6C37d+kApYS41Q59gm6ha09XCTAi3ghcQTXf9E0SBLhDL1A wrVeAeOP6vr51MfwAOtFYc4b+fagpNln7PKCtKW8fv3sRvhhT90lvxa9n5W3QJsH9Zto uEx40RamNaB+keu1gg8wNu/ICZPS5hqnLbTfc= MIME-Version: 1.0 Received: by 10.223.108.75 with SMTP id e11mr1432240fap.97.1238147864790; Fri, 27 Mar 2009 02:57:44 -0700 (PDT) In-Reply-To: <1238141231.16568.574.camel@ebony.2ndQuadrant> 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> <49CC8524.4090103@oss.ntt.co.jp> <1238141231.16568.574.camel@ebony.2ndQuadrant> Date: Fri, 27 Mar 2009 10:57:44 +0100 Message-ID: <1d4e0c10903270257v5f0f2fdev6b742066e13fd974@mail.gmail.com> Subject: Re: display previous query string of idle-in-transaction From: Guillaume Smet To: Simon Riggs Cc: Tatsuhito Kasahara , pgsql-hackers@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.072 tagged_above=0 required=5 tests=AWL=0.072 X-Spam-Level: X-Archive-Number: 200903/1126 X-Sequence-Number: 135804 On Fri, Mar 27, 2009 at 9:07 AM, Simon Riggs wrote: > Or take it further back still and think about why "idle in transaction" > occurs at all and fix *that*. Maybe not in Postgres at all, possibly in > the driver or even higher up client stack. From my experience, the main reasons for this problem are: - a poorly coded connection pool (a lot of people think they really should write their connection pooling solution themselves...); - a poorly coded application; - bugs in the code. So you really should try to fix them in your application first. That said, I have one case in mind where I wasn't able to fix completely the connection pool and the application and we still encounter idle in transaction connections from time to time. For this sort of case, a timeout would be a nice solution. -- Guillaume