Sequence reached maximum value
Your task
Postgres. At 09:14 every INSERT into the events table began failing with nextval: reached maximum value of sequence "events_id_seq" (2147483647). The table's id is the primary key. Writes to this one table are fully down; reads are fine. The table has billions of historical rows (many since deleted). There was no deploy. Triage, restore writes with minimal downtime, and prevent recurrence on other tables.
It covers
- Sequence exhaustion
- Int4 overflow
- Primary key