Waiting for 9.6 – Add idle_in_transaction_session_timeout.

I hate “idle in transaction" connections. These cause lots of problems, and while are generally easy to solve, in times where we have orms, web frameworks, various “work flows" in companies, and lots of developers – in many cases noone really seems to care about these (aside from dbas), and they don't get fixed.

Now, with this new patch, the problem is gone.

By default idle_in_transaction_session_timeout is set to 0, which means no timeout – transaction started will just continue forever.

But if I'll change it to something else, like 15 seconds:

$ SET idle_in_transaction_session_timeout ='15s';

Then start transaction, wait for 15 seconds (it's 15 seconds of idle in transaction, not “process some queries" in transaction), and then will try to run a query: