summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2013-12-12 17:40:00 +0000
committerTom Lane2013-12-12 17:40:00 +0000
commit17776250a5d3daca1c07dac59436932206b72aed (patch)
tree0462e5b044acc9ff7c382a63987f2ef3e4823def
parent52c342dd0241f18c16975da309585cfbc69e36d3 (diff)
Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31.
Pointed out by Gianni Ciolli.
-rw-r--r--doc/src/sgml/maintenance.sgml2
-rw-r--r--src/backend/access/transam/transam.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index 1a5258b9490..ba8323c0946 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -359,7 +359,7 @@
as <literal>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-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
diff --git a/src/backend/access/transam/transam.c b/src/backend/access/transam/transam.c
index bc02f15e868..cc99cb93b31 100644
--- a/src/backend/access/transam/transam.c
+++ b/src/backend/access/transam/transam.c
@@ -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;