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 1oGN1c-00018x-D7 for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Jul 2022 16:03:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oGN1b-0003O0-9O for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Jul 2022 16:03:11 +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 1oGN1b-0003Np-1Y for pgsql-bugs@lists.postgresql.org; Tue, 26 Jul 2022 16:03:11 +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 1oGN1Y-0008FV-U1 for pgsql-bugs@lists.postgresql.org; Tue, 26 Jul 2022 16:03:10 +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 26QG36po2361331; Tue, 26 Jul 2022 12:03:06 -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> <805866.1658175624@sss.pgh.pa.us> <2350990.1658848101@sss.pgh.pa.us> <2356216.1658849834@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Tue, 26 Jul 2022 08:48:23 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2361329.1658851386.1@sss.pgh.pa.us> Date: Tue, 26 Jul 2022 12:03:06 -0400 Message-ID: <2361330.1658851386@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > That leaves us with changing the documentation then, from: > CREATE DATABASE cannot be executed inside a transaction block. > to: > CREATE DATABASE cannot be executed inside an explicit transaction block (it > will error in this case), and will commit (or rollback on failure) any > implicit transaction it is a part of. That's not going to help anybody unless we also provide a definition of "implicit transaction", which is a bit far afield for that man page. I did miss a bet in the proposed pipeline addendum, though. I should have written ... However, there are a few DDL commands (such as CREATE DATABASE) that cannot be executed inside a transaction block. If one of these is executed in a pipeline, it will, upon success, force an immediate commit to preserve database consistency. That ties the info to our standard wording in the per-command man pages. regards, tom lane