From b57947aa9cacaac58b4baa7b30306ccf803d6c88 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 12 Dec 2013 12:39:54 -0500 Subject: [PATCH] Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31. Pointed out by Gianni Ciolli. --- doc/src/sgml/maintenance.sgml | 2 +- src/backend/access/transam/transam.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index 616e41d52d..ca1e82018f 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -401,7 +401,7 @@ as FrozenXID. This XID does not follow the normal XID comparison rules and is always considered older than every normal XID. Normal XIDs are - compared using modulo-231 arithmetic. This means + compared using modulo-232 arithmetic. This means that for every normal XID, there are two billion XIDs that are older and two billion that are newer; another way to say it is that the normal XID space is circular with no diff --git a/src/backend/access/transam/transam.c b/src/backend/access/transam/transam.c index 3cc0096d92..b92a27bff3 100644 --- a/src/backend/access/transam/transam.c +++ b/src/backend/access/transam/transam.c @@ -301,7 +301,7 @@ TransactionIdPrecedes(TransactionId id1, TransactionId id2) { /* * If either ID is a permanent XID then we can just do unsigned - * comparison. If both are normal, do a modulo-2^31 comparison. + * comparison. If both are normal, do a modulo-2^32 comparison. */ int32 diff;