X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 86D05329C63 for ; Mon, 20 Sep 2004 13:34:49 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 25227-04 for ; Mon, 20 Sep 2004 12:34:41 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 77981329CB0 for ; Mon, 20 Sep 2004 13:34:43 +0100 (BST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id i8KCYRK07220; Mon, 20 Sep 2004 08:34:27 -0400 (EDT) From: Bruce Momjian Message-Id: <200409201234.i8KCYRK07220@candle.pha.pa.us> Subject: Re: Implicit Transactions In-Reply-To: <414AF83E.AFA00204@noaa.gov> To: Chip Gobs Date: Mon, 20 Sep 2004 08:34:27 -0400 (EDT) Cc: pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/157 X-Sequence-Number: 19003 Chip Gobs wrote: > > We are porting from Informix to PostgreSQL 7.4.5 and have noticed the > following behavior. > > If we try to OPEN a CURSOR for an invalid SELECT statement in ECPG, we > get an error, as expected. However, if we then > attempt to OPEN another CURSOR for a valid statement, we get an error > that says we are in a failed transaction. At that point, no statement > will succeed. The only way we have found to get out of this state is > to ROLLBACK explicitly. > > We are not using explicit transactions. My understanding is that PG > should be rolling back failed statements when we are not in an > explicit transaction. > > Do we have an incorrect setting, a misunderstanding of how it is > supposed to work, or a bug? Could anyone enlighten me? ecpg defaults to open transaction by default. There is a command to change that in ecpg or during compile I think. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073