PostgreSQL's SERIAL (INT) primary keys risk integer overflow at 2.1 billion rows, but migrating to BIGINT costs virtually nothing due to 8-byte memory alignment. The article provides a complete zero-downtime migration strategy using an atomic swap technique: add a new BIGINT column, backfill data in batches with regular

12m read timeFrom crunchydata.com
Post cover image
Table of contents
Cost difference between INT and BIGINTLive data type change in Postgres - the atomic swapConclusion

Sort: