Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Dec 2013 17:40:07 +0000 (12:40 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Dec 2013 17:40:07 +0000 (12:40 -0500)
Pointed out by Gianni Ciolli.

doc/src/sgml/maintenance.sgml
src/backend/access/transam/transam.c

index 385ee20d0cfc4f494a6f9e8743ac7ebdcae4ba28..59d521b23b6121470cf3542d0cc5ac49013bc094 100644 (file)
     <productname>PostgreSQL</productname> distinguishes a special XID
     <literal>FrozenXID</>.  This XID is always considered older
     than every normal XID. Normal XIDs are
-    compared using modulo-2<superscript>31</> arithmetic. This means
+    compared using modulo-2<superscript>32</> arithmetic. This means
     that for every normal XID, there are two billion XIDs that are
     <quote>older</> and two billion that are <quote>newer</>; another
     way to say it is that the normal XID space is circular with no
index aa0881ae00a0a2683aac06b763bfa8a9e7f50bd0..43f7c54d1d91e8cf51dc1be52e087bff9c7ca285 100644 (file)
@@ -305,7 +305,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;