Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands - Mailing list pgsql-hackers

From Tom Lane
Subject Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands
Date
Msg-id 3032689.1667757257@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands  (Yugo NAGATA <nagata@sraoss.co.jp>)
Responses Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands
List pgsql-hackers
Yugo NAGATA <nagata@sraoss.co.jp> 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

diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/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 issue
  *    an error if we appear to be running inside a user-defined function (which
  *    could issue more commands and possibly cause a failure after the statement
@@ -3573,6 +3577,10 @@ CheckTransactionBlock(bool isTopLevel, bool throwError, 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 are
  *    inside a function.
  */

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: ssl tests aren't concurrency safe due to get_free_port()
Next
From: Andres Freund
Date:
Subject: Re: remap the .text segment into huge pages at run time