From: Tom Lane Date: Thu, 12 Dec 2013 17:39:57 +0000 (-0500) Subject: Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31. X-Git-Tag: REL9_2_7~62 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fcff4bd312bd70bfa01295a7c5e4db959ae105c8;p=postgresql Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31. Pointed out by Gianni Ciolli. --- diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index e9b8f97ae5..3577418a16 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 a7214cf34d..833f3cd1cc 100644 --- a/src/backend/access/transam/transam.c +++ b/src/backend/access/transam/transam.c @@ -304,7 +304,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;