Re: Terminating Idle Connections

From: "Uwe C(dot) Schroeder" <uwe(at)oss4u(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Cc: "Chris Hoover" <revoohc(at)gmail(dot)com>
Subject: Re: Terminating Idle Connections
Date: 2006-05-10 08:32:26
Message-ID: 200605100132.26849.uwe@oss4u.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


"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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ganesh Chaudhari 2006-05-10 10:03:18 suse rpms for postgresql-8.1.3
Previous Message Raphael Bolfing 2006-05-10 08:28:59 Postgresql8.1.3 tsearch2 with UTF8