PyGreSQL and transactions - Mailing list pgsql-interfaces

From Nagy Laszlo Zsolt , KLTE TTK pm1
Subject PyGreSQL and transactions
Date
Msg-id Pine.GSO.4.10.10007201213310.24509-100000@dragon
Whole thread Raw
Responses Re: PyGreSQL and transactions
List pgsql-interfaces
Hi all.

I'm writting a text-based server program with PyGreSQL.
My first problem follows:

>>> import pg
>>> db = pg.DB('gandalf','localhost',5432,None,None,'gandalf','')
>>> db.query('BEGIN')
>>> db.query("INSERT INTO tbl(s) VALUES('value1')")
NOTICE:  current transaction is aborted, queries ignored until end of transaction block
>>> db.query('commit')
>>> 

The notice was sent to stderr, it seems that I have no way to catch it.
There is getnotify(), but there is no getnotice(). I must catch it,
because my server must know if the operation was successful. (It is
in a multi-tier application's middle, and sends back a message about
the operation.)

Second problem:

>>> lo = db.locreate(pg.INV_WRITE)
>>> lo
Closed large object, oid 18863
>>> lo.open(pg.INV_WRITE)
Traceback (innermost last): File "<stdin>", line 1, in ?
IOError: can't open large object.
>>> 

I have compiled the PyGreSQL module without -DNO_LARGE.

Thank in advance:
 Laszlo Nagy nagylzs@delfin.klte.hu




pgsql-interfaces by date:

Previous
From: Carsten Zerbst
Date:
Subject: TCL API
Next
From: John Thorhauer
Date:
Subject: large object clean up