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 1orjrl-0003Kk-Uo for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Nov 2022 17:55:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1orjqk-0005fT-UJ for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Nov 2022 17:54:26 +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 1orjqk-0005fK-Kl for pgsql-hackers@lists.postgresql.org; Sun, 06 Nov 2022 17:54:26 +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 1orjqh-0008Ua-VJ for pgsql-hackers@postgresql.org; Sun, 06 Nov 2022 17:54:25 +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 2A6HsHtx3032690; Sun, 6 Nov 2022 12:54:19 -0500 From: Tom Lane To: Yugo NAGATA cc: 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: <20220930102342.852ad903b9c0418048c07fe5@sraoss.co.jp> 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> <20220930102342.852ad903b9c0418048c07fe5@sraoss.co.jp> Comments: In-reply-to Yugo NAGATA message dated "Fri, 30 Sep 2022 10:23:42 +0900" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <3032632.1667757201.0@sss.pgh.pa.us> Date: Sun, 06 Nov 2022 12:54:17 -0500 Message-ID: <3032689.1667757257@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3032632.1667757201.1@sss.pgh.pa.us> Yugo NAGATA writes: >> The attached patch tries to add comments explaining it on the functions. > I forward it to the hackers list because the patch is to fix comments. What do you think of the attached wording? I don't think the pipeline angle is of concern to anyone who might be reading these comments with the aim of understanding what guarantees they have. Perhaps there should be more about that in the user-facing docs, though. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="comments_on_PreventInTransactionBlock-2.patch"; charset="us-ascii" Content-ID: <3032632.1667757201.2@sss.pgh.pa.us> Content-Description: comments_on_PreventInTransactionBlock-2.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transa= m/xact.c index 883d6c0f70..8086b857b9 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -3448,6 +3448,10 @@ AbortCurrentTransaction(void) * a transaction block, typically because they have non-rollback-able * side effects or do internal commits. * + * If this routine completes successfully, then the calling statement is + * guaranteed that if it completes without error, its results will be + * committed immediately. + * * If we have already started a transaction block, issue an error; also i= ssue * an error if we appear to be running inside a user-defined function (wh= ich * could issue more commands and possibly cause a failure after the state= ment @@ -3573,6 +3577,10 @@ CheckTransactionBlock(bool isTopLevel, bool throwEr= ror, const char *stmtType) * a transaction block than when running as single commands. ANALYZE is * currently the only example. * + * If this routine returns "false", then the calling statement is + * guaranteed that if it completes without error, its results will be + * committed immediately. + * * isTopLevel: passed down from ProcessUtility to determine whether we ar= e * inside a function. */ ------- =_aaaaaaaaaa0--