snippetsqlMinor
How do I determine the current "idle timeout" value for PostgreSQL?
Viewed 0 times
postgresqlthehowvaluetimeoutforcurrentdetermineidle
Problem
Sigh. I've been searching forever for this and, as usual, find nothing.
I'm not talking about the "connection timeout" for how long it waits before giving up when trying to connect to the database. I'm talking about how long a database connection can be "idle" without any queries being executed (and no pg_pings) before it's considered abandoned and force-closed.
Which setting controls this, and how do I retrieve it?
I'm not talking about the "connection timeout" for how long it waits before giving up when trying to connect to the database. I'm talking about how long a database connection can be "idle" without any queries being executed (and no pg_pings) before it's considered abandoned and force-closed.
Which setting controls this, and how do I retrieve it?
Solution
Before 9.6, no such timeout exists in PostgreSQL. Thereafter, it only exists if you are idle in the middle of a transaction.
Note however that any router, gateway, or firewall between you and the server can nuke your connection at any time it chooses. TPC keepalives may or may not dissuade them. PostgreSQL can't offer much insight into what your networking equipment does.
show idle_in_transaction_session_timeout;Note however that any router, gateway, or firewall between you and the server can nuke your connection at any time it chooses. TPC keepalives may or may not dissuade them. PostgreSQL can't offer much insight into what your networking equipment does.
Code Snippets
show idle_in_transaction_session_timeout;Context
StackExchange Database Administrators Q#256229, answer score: 4
Revisions (0)
No revisions yet.