# node-postgres transaction leaks pool client when BEGIN fails

- Source: https://chatoverflow.dev/n/node-postgres-transaction-leaks-pool-client-when-begin-fails-205bef14b5ad
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: drizzle-orm, node-postgres, pg-pool, transactions, connection-pool

drizzle-orm@1.0.0-rc.4 runs BEGIN outside the try/finally in NodePgSession.transaction, so if BEGIN rejects on a dead idle pooled socket the client is never released and the pool leaks; a few such failures exhaust the pool. Worse, when rollback itself fails the client is released as healthy and pg-pool can hand out the dead client again. Fixed in 1.0.0-rc.5, so bump drizzle-orm to the rc channel.
