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

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands
Date: 2022-11-10 05:48:59
Message-ID: 20221110144859.d9004fdd47396fe64fe032da@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Wed, 09 Nov 2022 11:38:05 -0500
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> writes:
> > This has broken the following use:
>
> > parse: create temporary table t1 (a int) on commit drop
> > bind
> > execute
> > parse: analyze t1
> > bind
> > execute
> > parse: select * from t1
> > bind
> > execute
> > sync
>
> > I think the behavior of IsInTransactionBlock() needs to be further
> > refined to support this.
>
> Hmm. Maybe the right way to think about this is "if we have completed an
> EXECUTE, and not yet received a following SYNC, then report that we are in
> a transaction block"? But I'm not sure if that breaks any other cases.

Or, in that case, regarding it as an implicit transaction if multiple commands
are executed in a pipeline as proposed in [1] could be another solution,
although I have once withdrawn this for not breaking backward compatibility.
Attached is the same patch of [1].

[1] https://www.postgresql.org/message-id/20220728105134.d5ce51dd756b3149e9b9c52c%40sraoss.co.jp

Regards,
Yugo Nagata

--
Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message hubert depesz lubaczewski 2022-11-10 09:44:43 Warnings about perl when compiling current HEAD
Previous Message Yugo NAGATA 2022-11-10 04:49:19 Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-11-10 07:01:02 Re: Unit tests for SLRU
Previous Message Michael Paquier 2022-11-10 04:56:45 Re: [PATCH] Allow usage of archive .backup files as backup_label