PostgreSQL Transaction ID Wraparound: Prevention and Recovery
PostgreSQL's 32-bit transaction IDs wrap around after roughly two billion transactions of visibility horizon. How freezing prevents it, how to monitor age(datfrozenxid), and how to dig out of the emergency.