pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Implicit Transactions
2+ messages / 2 participants
[nested] [flat]

* Implicit Transactions
@ 2004-09-17 14:44 Chip Gobs <chip.gobs@noaa.gov>
  2004-09-20 12:34 ` Re: Implicit Transactions Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Chip Gobs @ 2004-09-17 14:44 UTC (permalink / raw)
  To: pgsql-sql


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?

Thanks,

Chip




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Implicit Transactions
  2004-09-17 14:44 Implicit Transactions Chip Gobs <chip.gobs@noaa.gov>
@ 2004-09-20 12:34 ` Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Bruce Momjian @ 2004-09-20 12:34 UTC (permalink / raw)
  To: Chip Gobs <chip.gobs@noaa.gov>; +Cc: pgsql-sql

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-09-20 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-09-17 14:44 Implicit Transactions Chip Gobs <chip.gobs@noaa.gov>
2004-09-20 12:34 ` Bruce Momjian <pgman@candle.pha.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox