Re: SET autocommit begins transaction?

Поиск
Список
Период
Сортировка
От Sean Chittenden
Тема Re: SET autocommit begins transaction?
Дата
Msg-id 20020918233246.GK99484@perrin.int.nxad.com
обсуждение исходный текст
Ответ на Re: SET autocommit begins transaction?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: SET autocommit begins transaction?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-bugs
> > > 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.

Really?  To me that makes perfect sense.  Logic:

*) Only BEGIN starts a transaction
*) Database or session tunables are adjusted with SET
*) Only things that happen inside of a transaction are rollback-able
*) SET operations that happen outside of a transaction are atomic
 changes that aren't subject to being rolled back

What about that doesn't make sense?  Having SET begin a transaction
seems like a gross violation of POLS and likely to contradict the spec
and cause problems with many applications.  -sc

--
Sean Chittenden

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: SET autocommit begins transaction?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: SET autocommit begins transaction?