Ian Bicking wrote:
> Also, someone mentioned PyGreSQL support at some point, but I lost the
> details. I tried adding it, but it acted weird, and I didn't try very
> hard. Can anyone test what's in CVS and see what needs to be done?
> Does anyone care about PoPy?
That was me. Here's the code I added to DBConnection.py
from pyPgSQL import PgSQL
PgSQL = None
__all__ = ['MySQLConnection', 'PostgresConnection', 'SQLiteConnection',
def __init__(self, dsn=None, host=None, db=None,
user=None, passwd=None, autoCommit=1, **kw):
assert PgSQL, 'PgSQL module cannot be found'
if not autoCommit and not kw.has_key('pool'):
# Pooling doesn't work with transactions...
kw['pool'] = 0
self.db = db
def _queryInsertID(self, conn, table, idName, names, values):
c = conn.cursor()
q = self._insertSQL(table, names, values)
print 'QueryIns: %s' % q
c.execute('SELECT %s FROM %s WHERE oid = %s'
% (idName, table, c.oidValue))
My PyPgSQLConnection class simply extends the existing
PostgresConnection class and redefines the methods that differ for
PyPgSQL. I haven't tested it formally (it was something of a 15 minutes
hack) but I've been using it for a few weeks without running in to any