[Zope-DB] Postgres + PgSQL

Jean Pierre Litsas Jean Pierre Litsas" <pierre@ods.com.br
Mon, 5 Nov 2001 09:00:58 -0300


Thanks gerhard, external method running ok now.
Pierre.
On Sun, Nov 04, 2001 at 04:24:10PM -0300, Jean Pierre Litsas wrote:
> Hi,
>
> I am using Zope 2.4.2 to calling a external method to select some rows in
> PostgreSQL 7.1.3, this external method use PgSQL 1.6 and   i am having
this
> error :
> Error Type: AttributeError
> Error Value: 'PgSQL' module has no attribute 'connect'

I'm not sure if this is a feature of Python or Zope, but there's an
incompletely loaded PgSQL in memory. Restart Zope and you will be fine.

Is there a way to let Zope do the equivalent of "unload module", btw.?

You probably have already done this, but:

you need to edit PgSQL.py and exchange the order of two import statements so
that they read like this instead of the other way round. This is so that
PgSQL
does *not* use Zope's internal DateTime module:

try:
    from mx import DateTime
except:
    import DateTime
from libpq import *

This won't be necessary anymore in pyPgSQL 2.0. The pyPgSQL DA will also be
in
CVS, soon.

Gerhard
--
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda
x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))