On Mon, Feb 20, 2023 at 12:57 PM Bryn Llewellyn <bryn@yugabyte.com> wrote:
3. Chapter 55 also has a section "Multiple Statements In A Simple Query". But this feature seems to do no more semantically beyond implicitly achieving what I could do by surrounding several statements explicitly with "begin; ... commit;". There is, though, the non-semantic aspect of round-trip reduction. It seems that psql doesn't expose doing many statements in a simple query. (At least, that's what I see in the server log when I put several statements on a single line (with psql's autocommit on).
IIRC psql -c 'insert into tbl values (1); select * from tbl;' uses the simply query protocol with multiple statements.
From:
Christophe Pettus Date: Subject:
Re: Thanks! Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?