Skip to content

Commit 1777625

Browse files
committed
Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31.
Pointed out by Gianni Ciolli.
1 parent 52c342d commit 1777625

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/src/sgml/maintenance.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@
359359
as <literal>FrozenXID</>. This XID does not follow the normal XID
360360
comparison rules and is always considered older
361361
than every normal XID. Normal XIDs are
362-
compared using modulo-2<superscript>31</> arithmetic. This means
362+
compared using modulo-2<superscript>32</> arithmetic. This means
363363
that for every normal XID, there are two billion XIDs that are
364364
<quote>older</> and two billion that are <quote>newer</>; another
365365
way to say it is that the normal XID space is circular with no

src/backend/access/transam/transam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ TransactionIdPrecedes(TransactionId id1, TransactionId id2)
305305
{
306306
/*
307307
* If either ID is a permanent XID then we can just do unsigned
308-
* comparison. If both are normal, do a modulo-2^31 comparison.
308+
* comparison. If both are normal, do a modulo-2^32 comparison.
309309
*/
310310
int32 diff;
311311

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy