hot_standby

A GUC parameter determining whether queries can be run on a standby

hot_standby is a GUC parameter determining whether queries can be run on a standby.

hot_standby was added in PostgreSQL 9.0.

Default value

The default value for hot_standby is:

Note that hot_standby has no effect when run on a server which is not in recovery.

Usage

If hot_standby is set to on, read-only connections to a standby will be permitted. Status reported in postmaster.pid will be set to ready (PostgreSQL 10 and later).

If hot_standby is set to off, connections to a standby will fail, e.g.:

psql
psql: error: could not connect to server: FATAL:  the database system is starting up

and a corresponding entry will be made in the log file:

[2020-09-12 14:17:44 UTC] [unknown] postgres postgres LOCATION:  ProcessStartupPacket, postmaster.c:2320

Status reported in postmaster.pid will be set to standby (PostgreSQL 10 and later).

Change history

Categories

GUC configuration item, Replication

See also

wal_level, hot_standby_feedback