Re: SET autocommit begins transaction? - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: SET autocommit begins transaction?
Date
Msg-id 200209182326.g8INQbj09369@candle.pha.pa.us
Whole thread Raw
In response to Re: SET autocommit begins transaction?  (Sean Chittenden <sean@chittenden.org>)
Responses Re: SET autocommit begins transaction?  (Sean Chittenden <sean@chittenden.org>)
List pgsql-bugs
Sean Chittenden wrote:
> > I am fine with special casing autocommit.  Is that what you are
> > suggesting?
>
> I think he means:
>
> Ex:
> SET autocommit TO off;
> SHOW autocommit;
> ROLLBACK;
> # warning about being outside of a transaction
> BEGIN;
> SET autocommit TO on;
> SHOW autocommit;    # shows on
> ROLLBACK;
> SHOW autocommit;    # shows off
>
> Only have the SET's in a transaction/rollback-able if they're made
> inside of a transaction, otherwise leave them as atomic changes.  -sc

But it seems so illogical that SET doesn't start a transaction, but if
it is in a transaction, it is rolled back, and this doesn't help our
statement_timeout example except to require that they do BEGIN to start
the transaction even when autocommit is off.

--
  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

pgsql-bugs by date:

Previous
From: Sean Chittenden
Date:
Subject: Re: SET autocommit begins transaction?
Next
From: Bruce Momjian
Date:
Subject: Re: SET autocommit begins transaction?