Idle-in-Transaction Sessions
pg_views: pg_stat_activity
Full detection logic, thresholds, and guided fixes ship in the product.
Book a demo →Overview
A session in state 'idle in transaction' has an open transaction but is not executing any query. The application opened a BEGIN, ran some work, and then paused—perhaps waiting for user input, a network call, or a bug that leaked the connection without a COMMIT or ROLLBACK. The transaction holds all its acquired locks and pins the VACUUM xmin horizon for the entire duration.
Idle-in-transaction sessions are especially dangerous in connection-pooled environments because the pool believes the connection is free while Postgres has it locked up. The recommended fix is to set idle_in_transaction_session_timeout at the database or role level so Postgres automatically terminates these sessions.
See this rule in action
Full detection logic, thresholds, and guided fixes ship in the product. The licensed agent runs this check — and all others — continuously against your database, surfaces findings with AI explanations, and surfaces a guided remediation path inside the dashboard.
Book a demo →Common False Positives
- Two-phase commit (PREPARE TRANSACTION) workflows intentionally leave transactions open — these appear as idle in transaction but are managed by the application's XA coordinator.
- Interactive psql sessions where a developer typed BEGIN and walked away — expected in development environments.
Idle-in-Transaction Sessions — and 100+ more checks — in the licensed product
Full detection logic, thresholds, and guided fixes ship in the product.
Book a demo →Last updated: 2026-05-13 · View the rule library