aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/libpq-int.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2010-06-23 21:54:13 +0000
committerRobert Haas <rhaas@postgresql.org>2010-06-23 21:54:13 +0000
commitd8cd283a08fe87579e3603eaa8fba4d1eca6a8ca (patch)
treec4773cfe409540fd14d1d119dcf1f9e571bec37f /src/interfaces/libpq/libpq-int.h
parentc1b617987d51ab244b07c9cbd01baee6ea3e786a (diff)
downloadpostgresql-d8cd283a08fe87579e3603eaa8fba4d1eca6a8ca.tar.gz
postgresql-d8cd283a08fe87579e3603eaa8fba4d1eca6a8ca.zip
Add TCP keepalive support to libpq.
This adds four additional connection parameters to libpq: keepalives, keepalives_idle, keepalives_count, and keepalives_interval. keepalives default to on, per discussion, but can be turned off by specifying keepalives=0. The remaining parameters, where supported, can be used to adjust how often keepalives are sent and how many can be lost before the connection is broken. The immediate motivation for this patch is to make sure that walreceiver will eventually notice if the master reboots without closing the connection cleanly, but it should be helpful in other cases as well. Tollef Fog Heen, Fujii Masao, and me.
Diffstat (limited to 'src/interfaces/libpq/libpq-int.h')
-rw-r--r--src/interfaces/libpq/libpq-int.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h
index 6fe96ab1684..23b914abbc5 100644
--- a/src/interfaces/libpq/libpq-int.h
+++ b/src/interfaces/libpq/libpq-int.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.150 2010/03/13 14:55:57 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.151 2010/06/23 21:54:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -300,6 +300,10 @@ struct pg_conn
char *replication; /* connect as the replication standby? */
char *pguser; /* Postgres username and password, if any */
char *pgpass;
+ char *keepalives; /* use TCP keepalives? */
+ char *keepalives_idle; /* time between TCP keepalives */
+ char *keepalives_interval; /* time between TCP keepalive retransmits */
+ char *keepalives_count; /* maximum number of TCP keepalive retransmits */
char *sslmode; /* SSL mode (require,prefer,allow,disable) */
char *sslkey; /* client key filename */
char *sslcert; /* client certificate filename */