Lesson 5 of 14

Hot Standby and Recovery Conflicts

Applies to PostgreSQL 13–17 Last reviewed May 2026 Grounded in source

The one thing to understand first

Hot standby lets a streaming standby serve read-only queries while it continuously replays WAL from the primary. This is how PostgreSQL scales reads: route SELECT traffic to one or more standbys. But it creates a tension that does not exist on the primary — the standby is doing two things at once: replaying changes and answering queries against the data those changes are modifying.

A recovery conflict is fundamentally unsolvable in the moment: when replayed WAL would remove rows a standby query still needs, PostgreSQL can keep replay current or keep the query alive, never both. Every hot-standby knob is just a choice about which side loses.

Why recovery conflicts happen

The standby replays the primary’s WAL, including operations that remove data a running query still needs to see. The classic case: vacuum on the primary removes dead tuples; that removal arrives as a WAL <a class="sev1-termlink" href="https://thesev1database.com/glossary/tuple/" title="Tuple">record; replaying it would delete row versions that a long-running query on the standby is still reading under its MVCC snapshot. The replay and the query conflict over the same rows — a recovery conflict.

This is a Pro lesson

Get every Learning Pathway and cookbook recipe — grounded in PostgreSQL source code, with diagnostics, fixes, and prevention for each topic.

Continue this lesson to learn:

  • The forced choice
  • Layer 3 — Watch it happen on your own database
  • Layer 4 — The levers this hands you
  • Layer 5 — What an Oracle DBA should expect vs what they get
  • Key takeaway
  • How this article was written
  • All 36 Learning Pathway lessons
  • 170+ cookbook recipes
  • Source-grounded diagnostics & fixes

Secure checkout Cancel anytime Source-grounded

Was this helpful?

← Back to 04 — Advanced: Replication & HA Architecture