summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorÁlvaro Herrera <alvherre@kurilemu.de>2025-09-11 19:49:57 +0200
committerÁlvaro Herrera <alvherre@kurilemu.de>2025-09-11 19:49:57 +0200
commit1d5800019f68d81139021b8bab159b8578fcaa2b (patch)
tree75b9941165b4bbeb6fd3337335d69003ffab5cab /src
parente8cec3d1791c140398454aa561cf51659dd8243d (diff)
Improve comment about snapshot macros
The comment mistakenly had "the others" for "the other", but this commit also reorders the comment so it matches the macros below. Now we describe the levels in increasing strictness. In addition, it seems easier to follow if we introduce one level at a time, rather than describing two, followed by "the other" (and then jumping back to one of the first two). Finally, reword the sentence about the purpose of the macros, which was slightly off-point. Author: Paul Jungwirth <pj@illuminatedcomputing.com> Reviewed-by: Rustam ALLAKOV <rustamallakov@gmail.com> Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Discussion: https://postgr.es/m/CA+renyUp=xja80rBaB6NpY3RRdi750y046x28bo_xg29zKY72Q@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/include/access/xact.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/include/access/xact.h b/src/include/access/xact.h
index b2bc10ee041..4528e51829e 100644
--- a/src/include/access/xact.h
+++ b/src/include/access/xact.h
@@ -43,10 +43,11 @@ extern PGDLLIMPORT int XactIsoLevel;
/*
* We implement three isolation levels internally.
- * The two stronger ones use one snapshot per database transaction;
- * the others use one snapshot per statement.
- * Serializable uses predicate locks in addition to snapshots.
- * These macros should be used to check which isolation level is selected.
+ * The weakest uses one snapshot per statement;
+ * the two stronger levels use one snapshot per database transaction.
+ * Serializable uses predicate locks in addition to the snapshot.
+ * These macros can be used to determine which implementation to use
+ * depending on the prevailing serialization level.
*/
#define IsolationUsesXactSnapshot() (XactIsoLevel >= XACT_REPEATABLE_READ)
#define IsolationIsSerializable() (XactIsoLevel == XACT_SERIALIZABLE)