Skip to content

Commit e613ace

Browse files
committed
Doc: add comments about PreventInTransactionBlock/IsInTransactionBlock.
Add a little to the header comments for these functions to make it clearer what guarantees about commit behavior are provided to callers. (See commit f929441 for context.) Although this is only a comment change, it's really documentation aimed at authors of extensions, so it seems appropriate to back-patch. Yugo Nagata and Tom Lane, per further discussion of bug #17434. Discussion: https://postgr.es/m/17434-d9f7a064ce2a88a3@postgresql.org
1 parent b28ac1d commit e613ace

File tree

1 file changed

+8
-0
lines changed
  • src/backend/access/transam

1 file changed

+8
-0
lines changed

src/backend/access/transam/xact.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3448,6 +3448,10 @@ AbortCurrentTransaction(void)
34483448
* a transaction block, typically because they have non-rollback-able
34493449
* side effects or do internal commits.
34503450
*
3451+
* If this routine completes successfully, then the calling statement is
3452+
* guaranteed that if it completes without error, its results will be
3453+
* committed immediately.
3454+
*
34513455
* If we have already started a transaction block, issue an error; also issue
34523456
* an error if we appear to be running inside a user-defined function (which
34533457
* could issue more commands and possibly cause a failure after the statement
@@ -3573,6 +3577,10 @@ CheckTransactionBlock(bool isTopLevel, bool throwError, const char *stmtType)
35733577
* a transaction block than when running as single commands. ANALYZE is
35743578
* currently the only example.
35753579
*
3580+
* If this routine returns "false", then the calling statement is
3581+
* guaranteed that if it completes without error, its results will be
3582+
* committed immediately.
3583+
*
35763584
* isTopLevel: passed down from ProcessUtility to determine whether we are
35773585
* inside a function.
35783586
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy