Re: pg_stat_activity howto

From: raf <raf(at)raf(dot)org>
To: pgsql-admin(at)postgresql(dot)org, pygresql(at)Vex(dot)Net
Subject: Re: pg_stat_activity howto
Date: 2009-11-06 03:14:17
Message-ID: 20091106031417.GA16315@raf.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Kevin Grittner wrote:

> If a query is currently running, you will see the start of it. If no
> query is running on a connection, the connection will show '<IDLE>' or
> '<IDLE> in transaction' depending on whether the client has started a
> database transaction on that connection. While a transaction remains
> open it can interfere with the work of other connections, including
> some important maintenance activities (particularly VACUUM), so if
> connections linger in '<IDLE> in transaction' state for a long time,
> you should investigate. It is normally a client-side programming bug.

hi,

that's a worry :) i have a pygresql-using user application
(postgres-8.3.7, python-2.6, pygresql-3.8.1) that is always
idle in transaction when it is idle. upon connecting, it
calls a few database functions, committing after each one.
after that, it's idle in transaction until the next bout of
db activity.

can anyone explain what i'm doing wrong in the attached example?

cheers,
raf

Attachment Content-Type Size
idle_in_translation.py text/x-python 485 bytes

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David Schnur 2009-11-06 15:59:57 REINDEX disk space requirements
Previous Message Vladimir Rusinov 2009-11-05 21:48:33 Re: fighting '<IDLE> in transaction'