From 7669ce908f70a7f6c1678cdc92be5c0685131e11 Mon Sep 17 00:00:00 2001 From: "Paul A. Jungwirth" Date: Fri, 11 Oct 2024 15:43:10 -0700 Subject: [PATCH v1] Distinguish between streaming replication and physical Our docs still use the term "streaming replication" in places where they really mean physical replication. These changes try to clarify the language around streaming replication, physical replication, and logical replication. In particular we should avoid suggesting that "streaming" and "logical" are opposites or alternatives. --- doc/src/sgml/config.sgml | 13 +++++++------ doc/src/sgml/high-availability.sgml | 12 ++++++++++-- doc/src/sgml/logicaldecoding.sgml | 6 +++--- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 9707d5238da..8a59842d72d 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -4367,15 +4367,16 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows Replication - These settings control the behavior of the built-in - streaming replication feature (see - ), and the built-in - logical replication feature (see + These settings control the behavior of + streaming replication, + both physical replication + (see ) and + logical replication (see ). - For streaming replication, servers will be either a + For physical replication, servers will be either a primary or a standby server. Primaries can send data, while standbys are always receivers of replicated data. When cascading replication (see ) is used, standby servers @@ -4768,7 +4769,7 @@ ANY num_sync ( standby server that is - to receive replication data. Their values on the primary server + to receive physical replication data. Their values on the primary server are irrelevant. diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml index acf3ac0601d..331f90e4521 100644 --- a/doc/src/sgml/high-availability.sgml +++ b/doc/src/sgml/high-availability.sgml @@ -151,7 +151,7 @@ protocol to make nodes agree on a serializable transactional order. A standby server can be implemented using file-based log shipping - () or streaming replication (see + () or streaming physical replication (see ), or a combination of both. For information on hot standby, see . @@ -628,7 +628,7 @@ protocol to make nodes agree on a serializable transactional order. In standby mode, the server continuously applies WAL received from the primary server. The standby server can read WAL from a WAL archive (see ) or directly from the primary - over a TCP connection (streaming replication). The standby server will + over a TCP connection (streaming physical replication). The standby server will also attempt to restore any WAL found in the standby cluster's pg_wal directory. That typically happens after a server restart, when the standby replays again WAL that was streamed from the @@ -772,6 +772,14 @@ archive_cleanup_command = 'pg_archivecleanup /path/to/archive %r' generated, without waiting for the WAL file to be filled. + + + This discussion of streaming replication assumes physical replication. + Although you could treat a logical replication subscriber as a warm standby, + it would require some differences to what is described here. + + + Streaming replication is asynchronous by default (see ), in which case there is diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml index 1c4ae38f1b9..706f0ea6fba 100644 --- a/doc/src/sgml/logicaldecoding.sgml +++ b/doc/src/sgml/logicaldecoding.sgml @@ -275,9 +275,9 @@ postgres=# select * from pg_logical_slot_get_changes('regression_slot', NULL, NU - PostgreSQL also has streaming replication slots - (see ), but they are used somewhat - differently there. + PostgreSQL can also use streaming replication slots + to maintain a standby server (see ), but + typically those use physical replication, not logical. -- 2.45.0