Re: BUG #11822: ECPG Commit or Rollback error - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #11822: ECPG Commit or Rollback error
Date
Msg-id 17993.1414592097@sss.pgh.pa.us
Whole thread Raw
In response to BUG #11822: ECPG Commit or Rollback error  (jlsanz1983@gmail.com)
List pgsql-bugs
jlsanz1983@gmail.com writes:
> Hi when a cursor is open and a fetch is in progres if then uses a commit or
> rollback instruction before close the cursor.
> The cursor get this error:
> sqlerrm.sqlerrmc: cursor "bolas" does not exist on line 141
> If the commit goes after close the cursor then the execution doesn't return
> any error.

That sounds like expected behavior to me: ordinary cursors are
automatically closed at transaction end.

If you really need this to work, you can declare the cursor WITH HOLD,
but that entails a performance penalty.

            regards, tom lane

pgsql-bugs by date:

Previous
From: jlsanz1983@gmail.com
Date:
Subject: BUG #11822: ECPG Commit or Rollback error
Next
From: Tom Lane
Date:
Subject: Re: BUG #11638: Transaction safety fails when constraints are dropped and analyze is done