ReplicationReload, no restartdefault off
hot_standby_feedback
Allows feedback from a hot standby to the primary that will avoid query conflicts.
How you change it
Reload, no restart
Defaults and ranges on this page were read from pg_settings on live PostgreSQL 18.4. Treat older majors as needing their own check before you copy a value.
What this means
When on, a hot-standby replica tells the primary which old row versions its running queries still need, so the primary delays vacuuming them away. This prevents 'canceling statement due to conflict with recovery' errors on the standby, at the cost of some extra bloat on the primary.
When it matters
Turn on when you run long read queries on a standby and want them to stop being cancelled.
| Default | off |
|---|---|
| Type | bool |
| Change scope | Reload, no restart |
| Category | Replication |
Check the current value
SHOW hot_standby_feedback;Tradeoffs
- • On: fewer query cancellations on the standby, but the primary keeps dead rows longer (more bloat).
- • Off: the primary vacuums freely, but long standby queries may be cancelled by recovery conflicts.
- • A long-running query on the standby can hold back cleanup cluster-wide -- watch for it.