Re: Trans-transactions cursors - Mailing list pgsql-hackers

From Christof Petig
Subject Re: Trans-transactions cursors
Date
Msg-id 3BA7386F.433DF899@petig-baender.de
Whole thread Raw
In response to Trans-transactions cursors  ("Ludovic Pénet" <lpenet@cubicsoft.com>)
List pgsql-hackers
Chamanya wrote:

> I am currently building a small web based app, with postgres as back end. I
> found that in ecpg you can declare and use cursor without declaring a
> transaction. In several places I have used cursors for selects only. That's
> the only way I found to make ecpg fetch multiple rows.
>
> And in ecpg I have to give an explicit open cursor statement to make fetching
> possible.

That's simply because ecpg starts a new transaction on any SQL statement if no
transaction is active.
I consider this (autocommit on) one of the worst traps you can lay for yourself.

Christof




pgsql-hackers by date:

Previous
From: Haller Christoph
Date:
Subject: Re: triggers procedures listing URGENT
Next
From: "Marc G. Fournier"
Date:
Subject: Re: CVS access problem