Top
Enterprise Postgres 17 SP1 Application Development Guide

5.4.2 Creating Applications while in Database Multiplexing Mode

This section explains points to consider when creating applications while in database multiplexing mode.

See

  • Refer to the Cluster Operation Guide (Database Multiplexing) for information on database multiplexing mode.

  • Refer to "Application Development" in the Cluster Operation Guide (PRIMECLUSTER) for points to consider when creating applications using the failover feature integrated with the cluster software.

5.4.2.1 Errors when an Application Connection Switch Occurs and Corresponding Actions

If an application connection switch occurs while in database multiplexing mode, explicitly close the connection and then reestablish the connection or reexecute the application.

The table below shows errors that may occur during a switch, and the corresponding action to take.

State

Error information

Action

Server failure
or
Fujitsu Enterprise Postgres system failure

Failure occurs during access

PGRES_FATAL_ERROR(*1)

57P01(*2)

NULL(*2)

After the switch is complete, reestablish the connection, or reexecute the application.

Accessed during system failure

CONNECTION_BAD(*3)

Switch to the standby server

Switched during access

PGRES_FATAL_ERROR(*1)

57P01(*2)

NULL(*2)

Accessed during switch

CONNECTION_BAD(*3)

*1: Return value of PQresultStatus().

*2: Return value of PQresultErrorField() PG_DIAG_SQLSTATE.

*3: Return value of PQstatus().