Press "Enter" to skip to content

Sequence Integer Overflows and BIGINT in PostgreSQL

Laurenz Albe performs a migration:

In a previous article, I recommended using bigint for sequence-generated primary keys (but I make an exception for lookup tables!). If you didn’t heed that warning, you might experience integer overflow. That causes downtime and pain. So I thought it would be a good idea to show you how to monitor for the problem and how to keep the worst from happening.

Read on for the downtime-rich solution (thanks to table blocking), as well as a solution that requires less downtime.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.