PostgreSQL Transaction Wraparound – Can pg_dump Backup and Restore Help?

postgresql

I know the solution advocated is VACUUM. However, I was interested in knowing whether old versions of XIDs are marked as frozen when restoring a database dump using pg_dump.

Also, this blogpost mentions that the transaction wraparound issue was resolved after truncating one of the large tables that had not been auto-vacuumed. How did the truncation help?

Best Answer

When restoring database from pg_dump, it will re initialize transaction id on the database. So, just like the beginning You create a database. It needs time for another transaction wraparound.

Transaction id wraparound is count on a per table level. If a table is truncated, but still another table is possible to be wraparound.

Hope it helps