Re: idle in transaction with mod_perl - Mailing list pgsql-admin

From Andrew Sullivan
Subject Re: idle in transaction with mod_perl
Date
Msg-id 20021004150651.Q949@mail.libertyrms.com
Whole thread Raw
In response to Re: idle in transaction with mod_perl  (<mallah@trade-india.com>)
List pgsql-admin
On Fri, Oct 04, 2002 at 08:04:37PM +0530, mallah@trade-india.com wrote:
> I too use mod_perl + postgresql
> its perfectly ok to have "idle in transaction..."

Well, not really.  But it's probably normal.  See below.

> the persistant connections makes all the difference.

For some reason, most of the persistent
connection/pooling/auto-commit=off approaches in PostgreSQL issue a
BEGIN as soon as a transaction ends.

The problem with this is that several maintenance types of things --
VACUUM FULL being the most obvious -- will conflict with these kinds
of transactions.  If you happen to have a connection that stays idle
this way for a long time, it can cause you some little bits of grief
(like by not reclaiming as much disk as it otherwise would, or not
recycling as much in a non-blocking VACUUM, or other similar things).

The real answer is to change the connection pooling &c.  But since
that's not likely to happen in a lot of cases, you should just make
sure that you don't perpetually leave around idle connections.

A

--
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110


pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cannot start the PostgreSQL v7.1.3 database
Next
From: Chris Miles
Date:
Subject: Re: PostgreSQL and 2-node failover cluster solutions