Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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:

SET autocommit TO off;
SHOW autocommit;
# warning about being outside of a transaction
SET autocommit TO on;
SHOW autocommit;    # shows on
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


pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group