What parameter would you change to set how long Postgres waits before deciding a transaction has been interrupted and should be rolled back?

I have a client program that is being frequently terminated in the middle of updating a postgres database. I need to make sure that postgres catches the loss of connection to the client as quickly as possible and immediately rollsback the transaction.

I have control over the timeout settings on the program, if those matter. I also have control over the postgres database, but I'm not sure what I should be changing on either if not both.

  • 1
    Probably the statement_timeout rather than a "transaction timeout". Or maybe lock_timeout
    – user1822
    Nov 19, 2018 at 20:01
  • 1
    I'm not sure but this post looks like a duplictate of (or at least is closely related to) this question.
    – MDCCL
    Nov 19, 2018 at 20:03

1 Answer 1


idle_in_transaction_session_timeout (integer)

Releases locks on open transactions that have become idle.

idle_in_transaction_session_timeout parameter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.