Sets the time interval between optional checks that the client is still connected, while running queries.
At a glance
| Property | Value |
|---|---|
| Parameter | client_connection_check_interval |
| Category | Connections and Authentication |
| Default | 0 |
| Value type | integer |
| Change scope | Per-session (SET) |
| Available in | PostgreSQL 14, 15, 16, 17, 18, 19 (added in 14) |
What it does
Sets the time interval between optional checks that the client is still connected, while running queries. The check is performed by polling the socket, and allows long running queries to be aborted sooner if the kernel reports that the connection is closed.
This option relies on kernel events exposed by Linux, macOS, illumos and the BSD family of operating systems, and is not currently available on other systems.
(Description quoted from the official PostgreSQL documentation.)
How to apply a change
Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.
Inspect the current value and source with SHOW client_connection_check_interval; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'client_connection_check_interval';.
Tuning guidance
Set it (e.g. 5-10s) so the server notices a disconnected client mid-query and cancels wasted work; 0 disables the check. Useful where clients abandon long queries.
Reference
PostgreSQL documentation — client_connection_check_interval.