From: SourceForge.net <no...@so...> - 2006-06-02 13:55:22
|
Bugs item #1409818, was opened at 2006-01-19 12:03 Message generated for change (Comment added) made by ghaering You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=1409818&group_id=16528 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: libpq Group: None Status: Open Resolution: None Priority: 5 Submitted By: Peer (peergriebel) Assigned to: Nobody/Anonymous (nobody) Summary: Problem using SAVEPOINT Initial Comment: We are using PostgreSQL 8.1.1 with pyPgSQL-2.4.win32-py2.3.exe. Executing the following code in e.g. pgadmin works as expected: SAVEPOINT APS_SAVEPOINT2; SELECT persons.oid FROM persons WHERE person_id = '9'; ROLLBACK TO APS_SAVEPOINT2; SELECT persons.oid FROM persons WHERE person_id = '9' Executing the code inside of the python interface to PostgreSQL using: from pyPgSQL import PgSQL connection = PgSQL.connect(...) cursor=connection.cursor() cursor.execute("SAVEPOINT APS_SAVEPOINT2") cursor.execute("SELECT persons.oid FROM persons WHERE person_id = '9'") cursor.execute("ROLLBACK TRANSACTION TO SAVEPOINT APS_SAVEPOINT2") cursor.execute("SAVEPOINT APS_SAVEPOINT3") cursor.execute("SELECT persons.oid FROM persons WHERE person_id = '9'") does not work. An exception is raised: libpq.OperationalError: ERROR: current transaction is aborted, commands ignored until end of transaction block I can't see the reason. But I think it lies somewhere in libpq. ---------------------------------------------------------------------- >Comment By: Gerhard Häring (ghaering) Date: 2006-06-02 15:55 Message: Logged In: YES user_id=163326 I believe it has to do with portals. If you close the cursor and create a new one before the "ROLLBACK TRANSACTION", you don't get this error message. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=1409818&group_id=16528 |