To use the application connection switch feature, set the information shown below when connecting the database.
Specify the IP address or host name that will be used to configure the database multiplexing system.
A port number used by each database server to listen for connections from applications.
In each client interface, multiple port numbers can be specified, however in the format shown below, for example, if only one port number is specified, it will be assumed that host1:26500 (the default value) and host2:port2 were specified.
host1,host2:port2
Omit all port numbers, or specify only one per server.
From the specified connection destination server information, specify the selection sequence of the servers to which the application will connect. The values specified for the target server have the meanings shown below. If a value is omitted, primary will be used.
The primary server is selected as the connection target from the specified "IP addresses or host names". Specify this to perform tasks that can be performed only on the primary server, such as applications in line with updates, or management tasks such as REINDEX and VACUUM.
The standby server is selected preferentially as the connection target from the specified "IP addresses or host names". If there is no standby server, the application will connect to the primary server.
This value can be specified when the Mirroring Controller option is used.
This method is not recommended in database multiplexing systems. This is because, although the connection destination server is selected in the specified sequence from the specified "IP addresses or host names", if the server that was successfully connected to first is the standby server, the update will always fail.
This method is not published in the manuals for the PostgreSQL JDBC driver, but has a feature that performs the same type of connection, so this is provided for applications that depend strongly on that feature.
To perform SSL authentication by creating the same server certificate for each server in a multiplexing system, specify the SSL server certificate Common Name (CN) in this parameter. Accordingly, SSL authentication using the CN can be performed without having to consider the names of the multiple servers contained in the multiplexing system.