Re: Thanks! Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?

Поиск
Список
Период
Сортировка
От Christophe Pettus
Тема Re: Thanks! Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?
Дата
Msg-id 931EFF56-1B39-4EA9-B9C1-3D3E2315401B@thebuild.com
обсуждение исходный текст
Ответ на Thanks! Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?  (Bryn Llewellyn <bryn@yugabyte.com>)
Ответы Re: Thanks! Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?  (Bryn Llewellyn <bryn@yugabyte.com>)
Список pgsql-general

> On Feb 20, 2023, at 11:57, Bryn Llewellyn <bryn@yugabyte.com> wrote:
> 2. If I send over "begin" and then "insert into s.t(v) values(42)", then (so far) a second session will not see the
effectof my SQL's. It sees this only when I send over "commit". (If I send over "rollback" instead of "commit", then
othersessions never know what I did.) 

This may or may not be true.  If the second session currently has a transaction open in REPEATABLE READ or SERIALIZABLE
mode,it *won't* see the effects of that statement, since it took its snapshot at the start of the transaction (to be
technical,at the first statement in that transaction), and holds it until commit time.  However, a transaction in READ
COMMITTEDmode *will* see the results after the statement completes. 

> I can't see that a client-side "autocommit off" mode like psql supports brings me anything of value.

There's general agreement on that point.

    https://www.cybertec-postgresql.com/en/disabling-autocommit-in-postgresql-can-damage-your-health/


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_dump'ed file contains "DROP DATABASE"
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Thanks! Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?