Set idle_in_transaction_session_timeout in postgresql

postgresql

I want to close idle connection in postgresql and want to set idle_in_transaction_session_timeout. I log into postgresql and when entering show idle_in_transaction_session_timeout at prompt get the following error message:

[database]=> show idle_in_transaction_session_timeout;

and get the following error message:

ERROR: unrecognized configuration parameter
"idle_in_transaction_session_timeout"

If i enter [database]=> SET SESSION idle_in_transaction_session_timeout = 3000; get the following error message:

ERROR: unrecognized configuration parameter
"idle_in_transaction_session_timeout"

Where do consult and set this variable in posrgresql? Thank you.

Best Answer

From my install of Postgresql on a BSD server. The option you're looking for is declared in postgresql.conf in the folder: var/db/postgresql/data96

as:

#idle_in_transaction_session_timeout = 0        # in milliseconds, 0 is disabled

Its location on your install is dependent upon the OS, and version of Postgresql you're using. In my case 9.6.

Short, and direct answer: postgresql.conf. :)

Related Question