Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>, Yugo Nagata <nagata@sraoss.co.jp>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2022-07-26T16:14:19Z
Lists: pgsql-bugs, pgsql-hackers
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> And we are back around to the fact that only by using libpq directly, or
> via the pipeline feature of pgbench, can one actually exert control over
> the implicit transaction.  The psql and general SQL interface
> implementation are just going to Sync after each command and so everything
> looks like one transaction per command to them and only explicit
> transactions matter.

Right.

> From that, the adjustment you describe above is sufficient for me.

Cool, I'll set about back-patching.

			regards, tom lane



Commits

  1. Rethink handling of [Prevent|Is]InTransactionBlock in pipeline mode.

  2. Doc: add comments about PreventInTransactionBlock/IsInTransactionBlock.

  3. Force immediate commit after CREATE DATABASE etc in extended protocol.