"Carlos H. Reimer" <carlosreimer@terra.com.br> writes:
> I would like to understand better the logic to determine when a xid is older
> than another one.
It's circular mod 2^32, with a special case for FrozenXID. It's a
mistake to imagine that XIDs are unsigned ints, really --- the
comparison doesn't work that way. For an XID of say 1billion, XIDs from
1billion to 3billion are "after", the rest "before". So once a row
is created, it has to be deleted or frozen within 2 billion
transactions, else its XID wraps around and appears to be "in the
future" rather than "in the past" compared to current XIDs.
regards, tom lane