PyGreSQL and transactions
От | Nagy Laszlo Zsolt , KLTE TTK pm1 |
---|---|
Тема | PyGreSQL and transactions |
Дата | |
Msg-id | Pine.GSO.4.10.10007201213310.24509-100000@dragon обсуждение исходный текст |
Ответы |
Re: PyGreSQL and transactions
|
Список | 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 по дате отправления: