~/talk

Advanced INT to BIGINT Conversions

Talkat Citus Con: An Event for Postgres 2022 · 2022-04-12..04-13· [databases]
slides:none on file

Postgres integer overflow hits around 2.1 billion and causes sudden outages; recommended quick fix is ALTER SEQUENCE to restart at a negative min (buying ~2 billion inserts) and then plan a migration to BIGINT. Practical migration uses a new BIGINT column, view+triggers to route reads/writes, batched backfill, and transactional DDL for fast metadata swaps. Also use a catalog+pg_stats query to locate INT columns, test with a default-function that injects high IDs, and watch for ORM bugs (e.g. Django sequence mismatch) and unsigned-int or client-side limits. ALTER SEQUENCE negative restart view + fut_y BIGINT + backfill

AI-written summary · about

  1. 0:00Introduction
  2. 1:45SMALLINT, BIGINT, INTEGER
  3. 5:25Avoiding the 'INTEGER' problem
  4. 13:45Dealing with overflows in production
  5. 19:57Other problems to consider
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.