X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 94AEB9F96B6 for ; Wed, 10 May 2006 05:32:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 61432-04 for ; Wed, 10 May 2006 05:32:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from oss4u.com (mail.oss4u.com [64.142.76.151]) by postgresql.org (Postfix) with SMTP id DA1299F931D for ; Wed, 10 May 2006 05:32:29 -0300 (ADT) Received: (qmail 23813 invoked from network); 10 May 2006 08:36:05 -0000 Received: from tiburon.oss4u.com (192.168.1.4) by gw.oss4u.com (192.168.1.1) with ESMTP; 10 May 2006 08:36:05 -0000 From: "Uwe C. Schroeder" To: pgsql-admin@postgresql.org Subject: Re: Terminating Idle Connections Date: Wed, 10 May 2006 01:32:26 -0700 User-Agent: KMail/1.8.2 Cc: "Chris Hoover" References: <1d219a6f0605091629g5651582cxe7e5eeddcc75f765@mail.gmail.com> In-Reply-To: <1d219a6f0605091629g5651582cxe7e5eeddcc75f765@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605100132.26849.uwe@oss4u.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/102 X-Sequence-Number: 21634 "idle in transaction" usually means the software using the database has a bug. Technically it means your software issues a "BEGIN" statement, but never a rollback or commit. PostgreSQL doesn't provide a way to kill processes that are blocked due to programming errors, that would kind of defeat the purpose. Try to find out what exactly causes this. It's definitely a transaction that was started but never ended. Maybe turning on SQL statement logging in postgresql.conf can help to find the culprit. On Tuesday 09 May 2006 16:29, Chris Hoover wrote: > Is there a way inside of Postgresql to automatically terminate idle > connections? I would like to terminate any connection to my database that > has not has any activity for a specified period of time. I would like to > be able to do this despite the state of the connection (the majority of my > truly idle connections show "idle in transaction" in the process table). I > would love for the db engine to do this, but if it can't, is there an easy > way to do this outside the database with some sort of script? > > If this is not possible, would there be a possibility of it being added to > a future version? > > thanks, > > Chris > > RH 4.0 AS > PostgreSQL 8.1.3 -- Open Source Solutions 4U, LLC 1618 Kelly St Phone: +1 707 568 3056 Santa Rosa, CA 95401 Cell: +1 650 302 2405 United States Fax: +1 707 568 6416