On 2013-09-11 15:06:23 -0400, Andrew Dunstan wrote: > > One thing that this made me wonder is why we don't have transaction_timeout, > or maybe transaction_idle_timeout.
Because it's harder than it sounds, at least if you want to support idle-in-transactions. Note that we do not support pg_cancel_backend() for those yet...
So we are left with pg_terminate_backend in a cron job. That mostly seems to work, because usually apps that abandon connections in the idle-in-transaction state will never check back on them anyway, but cancel would be nicer.
Also, I think it might lead to papering over actual issues with applications leaving transactions open. I don't really see a valid reason for an application needing cancelling of long idle transactions.
Some of us make a living, at least partially, by papering over issues with 3rd party applications that we have no control over!