PyGreSQL and transactions

From: "Nagy Laszlo Zsolt , KLTE TTK pm1" <nagylzs(at)dragon(dot)klte(dot)hu>
To: "pgsql-interfaces(at)postgreSQL(dot)org" <pgsql-interfaces(at)postgresql(dot)org>
Subject: PyGreSQL and transactions
Date: 2000-07-20 10:14:48
Message-ID: Pine.GSO.4.10.10007201213310.24509-100000@dragon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)delfin(dot)klte(dot)hu

Browse pgsql-interfaces by date

  From Date Subject
Next Message John Thorhauer 2000-07-20 10:52:24 large object clean up
Previous Message Andrea Aime 2000-07-20 07:45:37 [Fwd: Re: ODBC driver and referential integrity]