diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2013-12-12 12:39:48 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2013-12-12 12:39:48 -0500 |
commit | ccca6f56f5e027f28b033e5e2754e9ad18e8c9ae (patch) | |
tree | 1e644b719659abef23446d35931d86bef6cd431e | |
parent | f26099057a2818d85edc2a16e2d3161f4bd96bdc (diff) | |
download | postgresql-ccca6f56f5e027f28b033e5e2754e9ad18e8c9ae.tar.gz postgresql-ccca6f56f5e027f28b033e5e2754e9ad18e8c9ae.zip |
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.sgml | 2 | ||||
-rw-r--r-- | 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 b5a58c2f954..fb94596224b 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -401,7 +401,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 3cc0096d92a..b92a27bff36 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; |