Re: SET autocommit begins transaction?

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Thomas Lockhart <lockhart(at)fourpalms(dot)org>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: SET autocommit begins transaction?
Date: 2002-09-18 23:22:11
Message-ID: 20020918232211.GJ99484@perrin.int.nxad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> > ...
> > > I think if we special case autocommit we have to force it to start a
> > > transaction.
> >
> > Be aware that "SET AUTOCOMMIT" does *not* start a transaction in
> > other systems (at least in Ingres, where I first ran into the
> > feature).
> >
> > This case is illustrating a general issue with trying to bracket
> > variables within transactions; the "special case" is that if a
> > transaction is not open then the change should be global across
> > transactions.
> >
> > Any counterexamples would argue for two separate behaviors, not
> > for shoehorning everything into one, uh, shoe.
>
> 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

--
Sean Chittenden

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2002-09-18 23:26:37 Re: SET autocommit begins transaction?
Previous Message Bruce Momjian 2002-09-18 23:17:08 Re: SET autocommit begins transaction?