Re: [PyGreSQL] pg_stat_activity howto

Поиск
Список
Период
Сортировка
От raf
Тема Re: [PyGreSQL] pg_stat_activity howto
Дата
Msg-id 20091107010437.GB22871@raf.org
обсуждение исходный текст
Ответ на pg_stat_activity howto  (jo <jose.soares@sferacarta.com>)
Список 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 по дате отправления:

Предыдущее
От: raf
Дата:
Сообщение: Re: pg_stat_activity howto
Следующее
От: rahimeh khodadadi
Дата:
Сообщение: Re: configuration kerberos in Postgre sql