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

From Bruce Momjian
Subject Re: SET autocommit begins transaction?
Date
Msg-id 200209182159.g8ILxE010566@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:
> > > > Well there is discussion on whether a SET with autocommit off should
> > > > start a transaction if it is the first command.  Right now it does, and
> > > > clearly you have a case where it acts strangely.
> > >
> > > Problem is that through various DB APIs such as DBI, you can't
> > > garuntee to the user doing development that that it's the 1st command
> > > that they're performing.
> >
> > OK, but why does my suggestion not work:
> >
> >     SET autocommit = ON;
> >     COMMIT;
>
> Hrm... if I changed the DBI layer for Ruby to have:
>
> db['AutoCommit'] = true
>
> use 'SET autocommit = ON; COMMIT;' I think I'd be breaking tons of
> applications where they wouldn't be expecting the commit.

Actually, the current approved way is:

    BEGIN; SET autocommit = ON; COMMIT;

--
  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: Sean Chittenden
Date:
Subject: Re: SET autocommit begins transaction?