Postgresql – Wraparound Transaction ID

postgresqlpostgresql-9.6transaction

Once the txid has passed the the xmin/xmax 32 bit limit, and assuming you've not suffered any issues with wraparound because you've been correctly maintaining your tables (plenty of vacuums, vacuum freeze, etc.), what happens to the txid? Does it just continue to increment? If so, how do xmin and xmax store it?

Best Answer

It wraps around to FirstNormalTransactionId (which is 3), rather than to zero. And then it continues to increment and be stored into xmin and xmax like normal.