postgres.git / summary / log / commit / refs
commit 85eb066ecdba647fcf972425d67266271e35d5cb
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Thu Dec 12 17:40:07 2013 +0000
First released in: 9.4.0, 8.4.20, 9.0.16, 9.1.12, 9.2.7, 9.3.3
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 385ee20d0cf..59d521b23b6 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -356,7 +356,7 @@
<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
diff --git a/src/backend/access/transam/transam.c b/src/backend/access/transam/transam.c
index aa0881ae00a..43f7c54d1d9 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;
[parent: 884c6384a2db]