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

Поиск
Список
Период
Сортировка
От Bryn Llewellyn
Тема Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?
Дата
Msg-id 954ABE4C-C17B-4269-ACAD-DE47E696515E@yugabyte.com
обсуждение исходный текст
Ответы Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?  (Julien Rouhaud <rjuju123@gmail.com>)
Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?  (Christophe Pettus <xof@thebuild.com>)
Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?  (Christophe Pettus <xof@thebuild.com>)
Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
I’ve searched in vain for an account of how "autocommit" mode actually works. (I tried the built-in search feature
withinthe PG docs. And I tried Google.) 

It seems clear enough that turning "autocommit" mode "on" or "off" is done by using a client-env-specific command like
"\set"is psql, or "SET" in ECPG (Embedded SQL in C) or "self.session.set_session(autocommit=...)" in Python. And that
themode is a property of the current session. 

But it's not clear who actually implements the opening "start transaction" and the closing "commit" around every
submittedSQL statement when autocommit is "on". 

Is this done in client-side code (maybe implying three round trips per intended SQL statement)? Or is it done
server-side?


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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: Does Postgres 14 have a query cache?
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?