hot_standby

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

hot_standby is a configuration 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:

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 -d postgres -U postgres
psql: error: FATAL:  the database system is not accepting connections
DETAIL:  Hot standby mode is disabled.

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

[2021-05-17 07:27:23 UTC] [unknown] postgres postgres FATAL:  57P03: the database system is not accepting connections
[2021-05-17 07:27:23 UTC] [unknown] postgres postgres DETAIL:  Hot standby mode is disabled.

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

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

Change history

Categories

GUC configuration item, Replication

See also

wal_level, hot_standby_feedback, in_hot_standby