databasepostgresqltransactions

How to restrict the maximum duration of Postgres transactions?


On a Postgres server I want to limit the amount of time transactions may take before they are aborted.

There are two timeout settings in Postgres that relate to transaction, but I don't think that they do accomplish what I need:

Do you know if there is a way to to restrict the maximum duration of Postgres transactions?


Solution

  • There is no way to restrict the duration of a transaction. I the practical cases I have dealt with, a combination of the two parameters you quoted did the trick. But there is no way to limit the duration of a transaction that consists of millions of small statements with little idle time in between.