in_hot_standby
Fact — official short description: “Shows whether hot standby is currently active.”
Identity
Lifecycle
| Fact | Value |
|---|---|
| First observed | PG14 |
| Present in | PG14–19 Beta 3 |
| Removed in | No |
| Introduction commit | bf8a662c9afa — Introduce a new GUC_REPORT setting “in_hot_standby”. |
| Commit date | 2021-01-05 |
| Discussion | thread 1 |
Default history
| Versions | Raw boot_val |
Unit | Human value |
|---|---|---|---|
| PG14–19 Beta 3 | off |
— | off |
How it works
Shows whether hot standby is currently active. It is read-only and cannot be changed with SET or configuration-file edits.
It changes as recovery enters or leaves hot-standby operation and is intended for feature detection by SQL code.
Interpret it with hot_standby, max_standby_streaming_delay, hot_standby_feedback. Applications and operations tooling may read in_hot_standby for capability or environment detection, but cannot SET it; cross-cluster comparisons must account for build, initdb, and current-database differences.
Tuning advice
Advice. These are workload-specific starting points and must be validated with measurements.
| Workload | Guidance |
|---|---|
| OLTP | Not tunable. Record in_hot_standby as a deployment/capability fact; if it is unexpected, fix the binary, initdb, or database-creation process rather than trying SET. |
| OLAP | Not tunable. Use in_hot_standby to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible. |
| Small nodes | Not tunable. Preserve it in inventory and incident reports; do not custom-build or rebuild merely to change it without a demonstrated compatibility need. |
Pigsty
Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.
| Template | Effective value | Versus upstream boot | Source expression |
|---|---|---|---|
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG14–19 Beta 3 unmodified; OLAP: PG14–19 Beta 3 unmodified; CRIT: PG14–19 Beta 3 unmodified; TINY: PG14–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.
Common pitfalls
- Trying to change read-only in_hot_standby with SET or a configuration file.
- Assuming every cluster, database, or vendor build reports the same value.
- Ignoring the value in file-format or feature-compatibility checks.
- Treating reported metadata as a performance target instead of an environment fact.
Related parameters
hot_standby · max_standby_streaming_delay · hot_standby_feedback · primary_conninfo · block_size · data_checksums