Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands
Daniel Verite <daniel@manitou-mail.org>
From: "Daniel Verite" <daniel@manitou-mail.org>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>,
Bruce Momjian
<bruce@momjian.us>,
Yugo Nagata <nagata@sraoss.co.jp>,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2022-07-19T11:16:21Z
Lists: pgsql-bugs, pgsql-hackers
David G. Johnston wrote: > drop table if exists performupdate; > create table performupdate (val integer); > insert into performupdate values (2); > \startpipeline > update performupdate set val = val * 2; > --create database benchtest; > select 1/0; > --rollback > \endpipeline > DO $$BEGIN RAISE NOTICE 'Value = %', (select val from performupdate); END; > $$ > > I get this result - the post-pipeline DO block never executes and I > expected that it would. pgbench stops the script on errors. If the script was reduced to select 1/0; DO $$BEGIN RAISE NOTICE 'print this; END; $$ the DO statement would not be executed either. When the error happens inside a pipeline section, it's the same. The pgbench code collects the results sent by the server to clear up, but the script is aborted at this point, and the DO block is not going to be sent to the server. Best regards, -- Daniel Vérité https://postgresql.verite.pro/ Twitter: @DanielVerite
Commits
-
Rethink handling of [Prevent|Is]InTransactionBlock in pipeline mode.
- f48aa5df4e03 11.19 landed
- ae47f8a9664a 14.7 landed
- 942cc240f959 13.10 landed
- 1cca4a75ffb8 12.14 landed
- 18431ee6f511 15.2 landed
- 20432f873140 16.0 landed
-
Doc: add comments about PreventInTransactionBlock/IsInTransactionBlock.
- fec80da849f3 11.19 landed
- e70cd16f2223 15.2 landed
- e613ace1f0d5 16.0 landed
- 8befa05d7889 14.7 landed
- 1949135e79e8 13.10 landed
- 17e9ecac0118 12.14 landed
-
Force immediate commit after CREATE DATABASE etc in extended protocol.
- f92944137cde 16.0 landed
- a0c632c1dea7 15.0 landed
- 9e3e1ac458ab 11.17 landed
- 968b89257b11 12.12 landed
- 964f42aa297b 10.22 landed
- 6c193c2ace32 13.8 landed
- 3e1297a63f76 14.5 landed