Re: [PyGreSQL] pg_stat_activity howto - Mailing list pgsql-admin

From raf
Subject Re: [PyGreSQL] pg_stat_activity howto
Date
Msg-id 20091107010437.GB22871@raf.org
Whole thread Raw
In response to pg_stat_activity howto  (jo <jose.soares@sferacarta.com>)
List pgsql-admin
Christoph Zwerschke wrote:

> raf schrieb:
> >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?
>
> One thing is that you should always explicitely close cursors and
> connections when you do not need them any more.

the cursor should close automatically when the python object
is destroyed. and i need the db connection later so closing
that isn't efficient.

> But the real cause of your problem is that Pygres 3.8.1 used to
> implicitely start a connection after every commit(). I have improved
> this already 3 years ago. Please use the current version Pygres 4.0.

ah, so that's the reason. ok, now i have another reason to upgrade.

> -- Christoph

thanks,
raf


pgsql-admin by date:

Previous
From: raf
Date:
Subject: Re: pg_stat_activity howto
Next
From: rahimeh khodadadi
Date:
Subject: Re: configuration kerberos in Postgre sql