Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oso5j-0001H2-PN for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Nov 2022 16:38:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oso5h-0008LL-Hn for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Nov 2022 16:38:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oso5h-0008LB-8V for pgsql-hackers@lists.postgresql.org; Wed, 09 Nov 2022 16:38:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oso5a-0006mn-4u for pgsql-hackers@postgresql.org; Wed, 09 Nov 2022 16:38:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2A9Gc53E3995894; Wed, 9 Nov 2022 11:38:05 -0500 From: Tom Lane To: Peter Eisentraut cc: Yugo NAGATA , pgsql-hackers@postgresql.org, "David G. Johnston" , Bruce Momjian Subject: Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands In-reply-to: <65a899dd-aebc-f667-1d0a-abb89ff3abf8@enterprisedb.com> References: <17434-d9f7a064ce2a88a3@postgresql.org> <3190751.1657845414@sss.pgh.pa.us> <3498921.1657919211@sss.pgh.pa.us> <805866.1658175624@sss.pgh.pa.us> <2350990.1658848101@sss.pgh.pa.us> <2356216.1658849834@sss.pgh.pa.us> <2361330.1658851386@sss.pgh.pa.us> <2363212.1658852059@sss.pgh.pa.us> <20220728105134.d5ce51dd756b3149e9b9c52c@sraoss.co.jp> <3214515.1658976655@sss.pgh.pa.us> <20220809002102.b815cd4dad20fdc91dff5ce8@sraoss.co.jp> <65a899dd-aebc-f667-1d0a-abb89ff3abf8@enterprisedb.com> Comments: In-reply-to Peter Eisentraut message dated "Wed, 09 Nov 2022 17:24:43 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3995892.1668011885.1@sss.pgh.pa.us> Date: Wed, 09 Nov 2022 11:38:05 -0500 Message-ID: <3995893.1668011885@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut 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. regards, tom lane