Re: SET autocommit begins transaction?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Sean Chittenden <sean(at)chittenden(dot)org>
Cc: Rod Taylor <rbt(at)rbt(dot)ca>, Thomas Lockhart <lockhart(at)fourpalms(dot)org>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: SET autocommit begins transaction?
Date: 2002-09-19 00:52:07
Message-ID: 200209190052.g8J0q7q19120@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Sean Chittenden wrote:
> > Yes, with the BEGIN, it will roll back. With autocommit off, this:
> >
> > > >
> > > > set statement_timeout = 20;
> > > > query_with_error;
> > > > set statement_timeout = 0;
> > > > COMMIT;
> >
> > will not roll back to 0. It will be 20.
>
> But that's the correct/expected behavior, is it not? That's what I'd
> expect at least. I'd think it's a gotcha for those that aren't good
> about explicitly calling BEGIN, but most libraries should do that for
> you, ruby-dbi does and used to be overly zealous about that actually
> (I just fixed that last night as a matter of fact). -sc

I thought the whole idea of autocommit off was not having to call BEGIN?
Now you do if you want your SETs to be in your transaction. That's
pretty clear and can be explained in the SGML docs with autocommit.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-09-19 07:55:32 Bug #774: Sometimes we do not get the correct record set
Previous Message Sean Chittenden 2002-09-19 00:49:22 Re: SET autocommit begins transaction?