|
20 | 20 | #include <float.h> |
21 | 21 | #include <math.h> |
22 | 22 | #include <limits.h> |
| 23 | +#ifdef HAVE_POLL_H |
| 24 | +#include <poll.h> |
| 25 | +#endif |
23 | 26 | #ifndef WIN32 |
24 | 27 | #include <sys/mman.h> |
25 | 28 | #endif |
@@ -204,6 +207,7 @@ static bool check_autovacuum_work_mem(int *newval, void **extra, GucSource sourc |
204 | 207 | static bool check_effective_io_concurrency(int *newval, void **extra, GucSource source); |
205 | 208 | static bool check_maintenance_io_concurrency(int *newval, void **extra, GucSource source); |
206 | 209 | static bool check_huge_page_size(int *newval, void **extra, GucSource source); |
| 210 | +static bool check_client_connection_check_interval(int *newval, void **extra, GucSource source); |
207 | 211 | static void assign_pgstat_temp_directory(const char *newval, void *extra); |
208 | 212 | static bool check_application_name(char **newval, void **extra, GucSource source); |
209 | 213 | static void assign_application_name(const char *newval, void *extra); |
@@ -3501,6 +3505,17 @@ static struct config_int ConfigureNamesInt[] = |
3501 | 3505 | NULL, NULL, NULL |
3502 | 3506 | }, |
3503 | 3507 |
|
| 3508 | + { |
| 3509 | + {"client_connection_check_interval", PGC_USERSET, CLIENT_CONN_OTHER, |
| 3510 | + gettext_noop("Sets the time interval between checks for disconnection while running queries."), |
| 3511 | + NULL, |
| 3512 | + GUC_UNIT_MS |
| 3513 | + }, |
| 3514 | + &client_connection_check_interval, |
| 3515 | + 0, 0, INT_MAX, |
| 3516 | + check_client_connection_check_interval, NULL, NULL |
| 3517 | + }, |
| 3518 | + |
3504 | 3519 | /* End-of-list marker */ |
3505 | 3520 | { |
3506 | 3521 | {NULL, 0, 0, NULL, NULL}, NULL, 0, 0, 0, NULL, NULL, NULL |
@@ -11980,6 +11995,20 @@ check_huge_page_size(int *newval, void **extra, GucSource source) |
11980 | 11995 | return true; |
11981 | 11996 | } |
11982 | 11997 |
|
| 11998 | +static bool |
| 11999 | +check_client_connection_check_interval(int *newval, void **extra, GucSource source) |
| 12000 | +{ |
| 12001 | +#ifndef POLLRDHUP |
| 12002 | + /* Linux only, for now. See pq_check_connection(). */ |
| 12003 | + if (*newval != 0) |
| 12004 | + { |
| 12005 | + GUC_check_errdetail("client_connection_check_interval must be set to 0 on platforms that lack POLLRDHUP."); |
| 12006 | + return false; |
| 12007 | + } |
| 12008 | +#endif |
| 12009 | + return true; |
| 12010 | +} |
| 12011 | + |
11983 | 12012 | static void |
11984 | 12013 | assign_pgstat_temp_directory(const char *newval, void *extra) |
11985 | 12014 | { |
|
0 commit comments