DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Preset Options

in_hot_standby

Shows whether hot standby is currently active.

  • Default: off
  • Type: bool
  • Applies: Read-only

In plain words

Shows whether this server is currently a hot standby: a replica that is replaying WAL and allows read-only queries. It changes to off when the standby is promoted to primary.

For DBAs and operators

Added in PostgreSQL 14 and marked GUC_REPORT, so the server pushes it to clients automatically (like server_version). libpq's target_session_attrs=read-only / primary / standby uses it to pick the right host without an extra query. Equivalent to pg_is_in_recovery() while hot standby is enabled.

SHOW in_hot_standby;
SELECT pg_is_in_recovery();
-- connect to whichever host is the primary:
psql "host=db1,db2 dbname=app target_session_attrs=read-write"

How to change it

Fixed when PostgreSQL was built or the cluster was initialised. You can only read it.

See it in context

Hot standby and recovery conflicts Streaming replication

Related parameters

hot_standby default_transaction_read_only transaction_read_only

All Preset Options parameters