transaction-id-wraparound · unknown · also XID wraparound

Transaction ID wraparound

Transaction ID wraparound is the reuse of low counter values after a finite transaction identifier passes the end of its numeric range.

Normal 32-bit transaction identifiers use modular ordering. Without limiting the age of retained row versions, an old insertion identifier can eventually appear to be in the future. Freezing preserves old committed rows without relying on their original identifier's normal ordering. [1]

An epoch distinguishes successive cycles when retained with the low identifier. A 64-bit full identifier contains both components, while its 32-bit form loses the epoch. Identifier assignment order need not match transaction-start order. [2]

The same low number alone cannot distinguish generations from different cycles. Comparing counters after restore also requires a trustworthy identity and history. [3]

Relations

related
Serial number arithmetic, Write-ahead log, Lost write

Citations

  1. PostgreSQL 18 documentation: preventing transaction ID wraparound failures (accessed 2026-10-18)
  2. PostgreSQL 18 documentation: transactions and identifiers (accessed 2026-10-18)
  3. Hesela: ordering storage generations across counter wrap (accessed 2026-10-18)
Sources & caveats
  • These lifecycle and epoch details describe PostgreSQL 18; other transaction and journal formats require their own rules. [1] [2]

JSON: /data/terms/transaction-id-wraparound.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Transaction ID wraparound. Hesela. 2026-10-18. https://hesela.dev/terms/transaction-id-wraparound/