Home Explore Blog CI



postgresql

22th chunk of `doc/src/sgml/libpq.sgml`
8934695ee6382297c3e4518b1464f4af6c25b5e2c02fa7ba0000000100000fb8
 <varlistentry id="libpq-keepalives-idle" xreflabel="keepalives_idle">
      <term><literal>keepalives_idle</literal></term>
      <listitem>
       <para>
        Controls the number of seconds of inactivity after which TCP should
        send a keepalive message to the server.  A value of zero uses the
        system default. This parameter is ignored for connections made via a
        Unix-domain socket, or if keepalives are disabled.
        It is only supported on systems where <symbol>TCP_KEEPIDLE</symbol> or
        an equivalent socket option is available, and on Windows; on other
        systems, it has no effect.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="libpq-keepalives-interval" xreflabel="keepalives_interval">
      <term><literal>keepalives_interval</literal></term>
      <listitem>
       <para>
        Controls the number of seconds after which a TCP keepalive message
        that is not acknowledged by the server should be retransmitted.  A
        value of zero uses the system default. This parameter is ignored for
        connections made via a Unix-domain socket, or if keepalives are disabled.
        It is only supported on systems where <symbol>TCP_KEEPINTVL</symbol> or
        an equivalent socket option is available, and on Windows; on other
        systems, it has no effect.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="libpq-keepalives-count" xreflabel="keepalives_count">
      <term><literal>keepalives_count</literal></term>
      <listitem>
       <para>
        Controls the number of TCP keepalives that can be lost before the
        client's connection to the server is considered dead.  A value of
        zero uses the system default. This parameter is ignored for
        connections made via a Unix-domain socket, or if keepalives are disabled.
        It is only supported on systems where <symbol>TCP_KEEPCNT</symbol> or
        an equivalent socket option is available; on other systems, it has no
        effect.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="libpq-tcp-user-timeout" xreflabel="tcp_user_timeout">
      <term><literal>tcp_user_timeout</literal></term>
      <listitem>
       <para>
        Controls the number of milliseconds that transmitted data may
        remain unacknowledged before a connection is forcibly closed.
        A value of zero uses the system default. This parameter is
        ignored for connections made via a Unix-domain socket.
        It is only supported on systems where <symbol>TCP_USER_TIMEOUT</symbol>
        is available; on other systems, it has no effect.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="libpq-connect-replication" xreflabel="replication">
      <term><literal>replication</literal></term>
      <listitem>
      <para>
       This option determines whether the connection should use the
       replication protocol instead of the normal protocol.  This is what
       PostgreSQL replication connections as well as tools such as
       <application>pg_basebackup</application> use internally, but it can
       also be used by third-party applications.  For a description of the
       replication protocol, consult <xref linkend="protocol-replication"/>.
      </para>

      <para>
       The following values, which are case-insensitive, are supported:
       <variablelist>
        <varlistentry>
         <term>
          <literal>true</literal>, <literal>on</literal>,
          <literal>yes</literal>, <literal>1</literal>
         </term>
         <listitem>
          <para>
           The connection goes into physical replication mode.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><literal>database</literal></term>
         <listitem>
          <para>
           The connection goes into logical replication mode, connecting to
           the database specified in the <literal>dbname</literal>

Title: Connection Parameters: Keepalive Intervals, Counts, TCP Timeout, and Replication Mode
Summary
This section describes libpq connection parameters related to network connection management. 'keepalives_idle' sets the inactivity time (in seconds) before sending a TCP keepalive message. 'keepalives_interval' configures the retransmission interval (in seconds) for unacknowledged keepalive messages. 'keepalives_count' defines the maximum number of lost keepalive probes before the connection is considered dead. 'tcp_user_timeout' sets the unacknowledged data timeout (in milliseconds) before a connection is forcibly closed. Finally, 'replication' determines whether the connection uses the replication protocol, supporting values like 'true', 'on', 'yes', '1' for physical replication, and 'database' for logical replication.