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 1oDXEJ-0004jF-4n for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Jul 2022 20:20:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDXEH-0006iW-Jx for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Jul 2022 20:20:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDXEH-0006iD-BJ for pgsql-bugs@lists.postgresql.org; Mon, 18 Jul 2022 20:20:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDXEB-0003an-RE for pgsql-bugs@lists.postgresql.org; Mon, 18 Jul 2022 20:20:32 +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 26IKKO94805867; Mon, 18 Jul 2022 16:20:24 -0400 From: Tom Lane To: "David G. Johnston" cc: Bruce Momjian , Yugo Nagata , PostgreSQL mailing lists Subject: Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands In-reply-to: References: <17434-d9f7a064ce2a88a3@postgresql.org> <3190751.1657845414@sss.pgh.pa.us> <3498921.1657919211@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Mon, 18 Jul 2022 12:55:48 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <805865.1658175624.1@sss.pgh.pa.us> Date: Mon, 18 Jul 2022 16:20:24 -0400 Message-ID: <805866.1658175624@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Fri, Jul 15, 2022 at 2:06 PM Tom Lane wrote: >> Here's a draft patch to fix this. We basically just need to force >> finish_xact_command() in the same way as we do for transaction control >> statements. I considered using the same technology as the code uses >> for transaction control --- that is, statically check for the types of >> statements that are trouble --- but after reviewing the set of callers >> of PreventInTransactionBlock() I gave that up as unmaintainable. > This seems like too narrow a fix though. I read this, and I have absolutely no idea what you're talking about or what you concretely want to do differently. If it's just a documentation question, I agree that I didn't address docs yet. Probably we do need to put something in the protocol chapter pointing out that some commands will commit immediately. I'm not sure I buy your argument that there's a fundamental difference between simple and extended query protocol in this area. In simple protocol you can wrap an "implicit transaction" around several commands by sending them in one query message. What we've got here is that you can do the same thing in extended protocol by omitting Syncs. Extended protocol's skip-till-Sync-after-error behavior is likewise very much like the fact that simple protocol abandons the rest of the query string after an error. regards, tom lane