Skip to content

Commit ccca6f5

Browse files
committed
Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31.
Pointed out by Gianni Ciolli.
1 parent f260990 commit ccca6f5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/src/sgml/maintenance.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
as <literal>FrozenXID</>. This XID does not follow the normal XID
402402
comparison rules and is always considered older
403403
than every normal XID. Normal XIDs are
404-
compared using modulo-2<superscript>31</> arithmetic. This means
404+
compared using modulo-2<superscript>32</> arithmetic. This means
405405
that for every normal XID, there are two billion XIDs that are
406406
<quote>older</> and two billion that are <quote>newer</>; another
407407
way to say it is that the normal XID space is circular with no

src/backend/access/transam/transam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ TransactionIdPrecedes(TransactionId id1, TransactionId id2)
301301
{
302302
/*
303303
* If either ID is a permanent XID then we can just do unsigned
304-
* comparison. If both are normal, do a modulo-2^31 comparison.
304+
* comparison. If both are normal, do a modulo-2^32 comparison.
305305
*/
306306
int32 diff;
307307

0 commit comments

Comments
 (0)