Skip site navigation (1) Skip section navigation (2)

ZPsycopg - Losing Connections

From: David <davidr(at)talamh(dot)org(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: ZPsycopg - Losing Connections
Date: 2005-07-27 10:44:27
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Python 2.3.5 - Zope 2.7.5 - PostgreSQL 7.3.4 - Psycopg 1.1.18 -  
Solaris 8 (Intel)


I am experiencing a new problem, that was not present in the past on  
the above server. From the Zope error log:

Exception Type      OperationalError
Exception Value    PQsendQuery() -- There is no connection to the  
Traceback (innermost last):

Module ZPublisher.Publish, line 92, in publish
Module ZPublisher.BaseRequest, line 433, in traverse
Module Products.exUserFolder.exUserFolder, line 869, in validate
Module Products.exUserFolder.exUserFolder, line 1133, in listOneUser
Module Products.exUserFolder.pgAuthSource.pgAuthSource, line 244, in  
Module Shared.DC.ZRDB.DA, line 454, in __call__
<SQL instance at 922dd70>
Module Products.ZPsycopgDA.db, line 228, in query
OperationalError: PQsendQuery() -- There is no connection to the  

When I check in psql, I can see a connection still being there.
Using the query:
SELECT count(pg_stat_activity.datname) AS count,  
pg_stat_activity.datname FROM pg_stat_activity GROUP BY  
(Is this really showing active connections? Or just recent usage?)

If I use the close connection and then open connection buttons in the  
Z Psycopg Database Connection in Zope, I get the connection usually  
back. Sometimes I have to re-submit the properties to make it work,  

Properties settings are:
"Connect immediately" is checked
"Use Zope's internal DateTime module (instead of mxDateTime)" is checked
Transaction isolation level:  Serializable
Backend encoding: UTF-8
"Output Unicode strings" is not checked

This is fast becoming a real headache for us!

What has changed? We have recently increased the max_connections and  
shared_buffers for PostgreSQL and now run more Zope instances with  
now averaging about 40 connections from the database (using the query  
above). So this is an increase.

Any help on how I can find out what's going on here is very welcome!  
(or in short: HELP, PLEASE!)


pgsql-novice by date

Next:From: Terry Lee TuckerDate: 2005-07-27 11:13:53
Subject: Re: backend triggers communication with front-end
Previous:From: Stephan SzaboDate: 2005-07-26 22:35:46
Subject: Re: Functions that Return A Record

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group