How to set idle_in_transaction_session_timeout on our DB?


I want to set idle_in_transaction_session_timeout which allows for a timeout for unclosed/uncommitted transactions.


Heroku Postgres doesn't allow ALTER SYSTEM, however you can set idle_in_transaction_session_timeout at a DATABASE or ROLE level, for example at the DATABASE level:

SELECT current_database();

ALTER DATABASE your-database-name SET idle_in_transaction_session_timeout='30s'

You can also set this in a transaction and depending on which ORM/driver you're using it may even support setting idle_in_transaction_session_timeout at that level.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support