8000 Doc: add comments about PreventInTransactionBlock/IsInTransactionBlock. · postgres/postgres@fec80da · GitHub
[go: up one dir, main page]

Skip to content

Commit fec80da

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 9172375 commit fec80da

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
@@ -3206,6 +3206,10 @@ AbortCurrentTransaction(void)
32063206
* a transaction block, typically because they have non-rollback-able
32073207
* side effects or do internal commits.
32083208
*
3209+
* If this routine completes successfully, then the calling statement is
3210+
* guaranteed that if it completes without error, its results will be
3211+
* committed immediately.
3212+
*
32093213
* If we have already started a transaction block, issue an error; also issue
32103214
* an error if we appear to be running inside a user-defined function (which
32113215
* could issue more commands and possibly cause a failure after the statement
@@ -3332,6 +3336,10 @@ CheckTransactionBlock(bool isTopLevel, bool throwError, const char *stmtType)
33323336
* a transaction block than when running as single commands. ANALYZE is
33333337
* currently the only example.
33343338
*
3339+
* If this routine returns "false", then the calling statement is
3340+
* guaranteed that if it completes without error, its results will be
3341+
* committed immediately.
3342+
*
33353343
* isTopLevel: passed down from ProcessUtility to determine whether we are
33363344
* inside a function.
33373345
*/

0 commit comments

Comments
 (0)
0