Link Parameters
Table 1 Link parameters
Name of the host to connect to. If the host name starts with a slash (/), Unix-domain socket communications instead of TCP/IP communications are used. The value is the directory where the socket file is stored. If host is not specified, the default behavior is to connect to the Unix-domain socket in the /tmp directory (or the socket directory specified during database installation). On a machine without a Unix-domain socket, the default behavior is to connect to localhost. You can specify multiple host names by using a character string separated by commas (,). Multiple host names can be specified. | |
IP address of the host to connect to. The value is in standard IPv4 address format, for example, 172.28.40.9. If the machine supports IPv6, IPv6 address can also be used. If a non-null string is specified, TCP/IP communications are used. You can specify multiple IP addresses by using a character string separated by commas (,). Multiple IP addresses can be specified. Replacing host with hostaddr can prevent applications from querying host names, which may be important for applications with time constraints. However, a host name is required for GSSAPI or SSPI authentication methods. Therefore, the following rules are used:
| |
Port number of the host server, or the socket file name extension for Unix-domain connections. You can specify multiple port numbers by using a character string separated by commas (,). Multiple port numbers can be specified. | |
Name of the user to connect as. By default, the username is the same as the operating system name of the user running the application. | |
Database name. The default value is the same as the username. | |
Password to be used if the server requires password authentication. | |
Maximum timeout period of the connection, in seconds (in decimal integer string). The value 0 or null indicates infinity. You are not advised to set the connection timeout period to a value less than 2 seconds. | |
Client encoding for the connection. In addition to the values accepted by the corresponding server options, you can use auto to determine the correct encoding from the current environment in the client (the LC_CTYPE environment variable in the Unix system). | |
This parameter can be ignored. (This parameter was used to specify the location to which the debugging output of the server was sent). | |
Specifies a backup value for the application_name parameter. This value is used if no value is set for application_name through a connection parameter or the PGAPPNAME environment variable. It is useful to specify a backup value in a common tool program that wants to set a default application name but does not want it to be overwritten by the user. | |
Whether TCP keepalive is enabled on the client side. The default value is 1, indicating that the function is enabled. The value 0 indicates that the function is disabled. Ignore this parameter for Unix-domain connections. | |
The number of seconds of inactivity after which TCP should send a keepalive message to the server. The value 0 indicates that the default value is used. Ignore this parameter for Unix-domain connections or if keep-alive is disabled. | |
The number of seconds after which a TCP keepalive message that is not acknowledged by the server should be retransmitted. The value 0 indicates that the default value is used. Ignore this parameter for Unix-domain connections or if keep-alive is disabled. | |
Adds command-line options to send to the server at runtime. For example, adding -c comm_debug_mode=off to set the value of the GUC parameter comm_debug_mode to off. | |
Sets the read and write timeout interval of the client connection. | |
Specifies whether to enable SSL encryption.
| |
If this parameter is set to 1 (default value), the data transmitted over the SSL connection is compressed (this requires that the OpenSSL version be 0.9.8 or later). If this parameter is set to 0, compression will be disabled (this requires OpenSSL 1.0.0 or later). If a connection without SSL is established, this parameter is ignored. If the OpenSSL version in use does not support this parameter, it will also be ignored. Compression takes up CPU time, but it increases throughput when the bottleneck is the network. If CPU performance is a limiting factor, disabling compression can improve response time and throughput. | |
This parameter specifies the file name of the client SSL certificate. It replaces the default ~/.postgresql/postgresql.crt. If no SSL connection is established, this parameter is ignored. | |
This parameter specifies the location of the key used for the client certificate. It can specify the name of a file used to replace the default ~/.postgresql/postgresql.key, or specify a key obtained from an external "engine" that is a loadable module of OpenSSL. The description of an external engine should consist of a colon-separated engine name and an engine-related key identifier. If no SSL connection is established, this parameter is ignored. | |
This parameter specifies the name of a file that contains the SSL Certificate Authority (CA) certificate. If the file exists, the system authenticates the server certificate issued by one of these authorities. The default value is ~/.postgresql/root.crt. | |
This parameter specifies the file name of the SSL Certificate Revocation List (CRL). If a certificate listed in this file exists, the server certificate authentication will be rejected. The default value is ~/.postgresql/root.crl. | |
This parameter specifies the OS user of the server, for example, requirepeer=postgres. When a Unix-domain socket connection is established, if this parameter is set, the client checks whether the server process is running under the specified username at the beginning of the connection. If not, the connection will be interrupted by an error. This parameter can be used to provide server authentication similar to that of the SSL certificate on TCP/IP connections. (Note that if the Unix domain socket is in /tmp or another public writable location, any user can start a server for listening to the location. Use this parameter to ensure that your device is connected to a server that is run by a trusted user.) This option is supported only on platforms that implement the peer authentication method. | |
This parameter specifies the Kerberos service name used for GSSAPI authentication. For successful Kerberos authentication, this value must match the service name specified in the server configuration. | |
This parameter specifies the GSS library used for GSSAPI authentication. It is used only in the Windows OS. If this parameter is set to gssapi, libpq is forced to use the GSSAPI library to replace the default SSPI for authentication. | |
This parameter specifies the name of the service for which the additional parameter is used. It specifies a service name in pg_service.conf that holds the additional connection parameters. This allows the application to specify only one service name so that the connection parameters can be centrally maintained. | |
authtype is no longer used, so it is marked as a parameter not to be displayed. It is retained in an array so as not to reject the conninfo string from old applications that might still try to set it. | |
Specifies the name of the remote node connected to the local node. | |
Specifies whether the fenced udf RPC protocol uses UNIX domain sockets or special socket file names. The default value is 0, indicating that the UNIX domain socket mode is used and the file type is .s.PGSQL.%d. To use the fenced UDF mode, set this parameter to 1. In this case, the file type is .s.fencedMaster_unixdomain. | |
Specifies whether the connection should use replication protocols instead of common protocols. Protocols with this parameter configured are internal protocols used for PostgreSQL replication connections and tools such as pg_basebackup, while they can also be used by third-party applications. The following values, which are case-insensitive, are supported:
In physical or logical replication mode, only simple query protocols can be used. | |
Specifies the backend version to be passed to the remote end. | |
Sets the current protocol level. The default value is PROTO_TCP. | |
Specifies whether a client is allowed to connect to a fully encrypted database. The default value is 0. To enable this function, change the value to 1. | |
The value of connection_info is a JSON character string consisting of driver_name, driver_version, driver_path, and os_user. If the value is not null, use connection_info and ignore connectionExtraInf. If the value is null, a connection information string related to libpq is generated. When connectionExtraInf is set to false, the value of connection_info consists of only driver_name and driver_version. | |
Specifies whether the value of connection_info contains extension information. The default value is 0. If the value contains other information, set this parameter to 1. | |
Specifies the type of the host to be connected. The connection is successful only when the host type is the same as the configured value. The rules for setting target_session_attrs are as follows:
|