Skip to content

Commit fcff4bd

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

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
@@ -304,7 +304,7 @@ TransactionIdPrecedes(TransactionId id1, TransactionId id2)
304304
{
305305
/*
306306
* If either ID is a permanent XID then we can just do unsigned
307-
* comparison. If both are normal, do a modulo-2^31 comparison.
307+
* comparison. If both are normal, do a modulo-2^32 comparison.
308308
*/
309309
int32 diff;
310310

0 commit comments

Comments
 (0)