pg_createsubscriber clarification

Started by Bruce Momjianalmost 2 years ago4 messagesdocs
Jump to latest
#1Bruce Momjian
bruce@momjian.us

The pg_createsubscriber docs say:

https://www.postgresql.org/docs/17/app-pgcreatesubscriber.html

After a successful run, the state of the target server is analogous
to a fresh logical replication setup. The main difference between
the logical replication setup and pg_createsubscriber is the
initial data copy. It does only the synchronization phase, which
ensures each table is brought up to a synchronized state.

What does "it" and "synchronization phase" mean in "It does only the
synchronization phase"? Seems this needs improvement.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

#2Masahiko Sawada
sawada.mshk@gmail.com
In reply to: Bruce Momjian (#1)
Re: pg_createsubscriber clarification

On Sun, Jul 28, 2024 at 1:23 AM Bruce Momjian <bruce@momjian.us> wrote:

The pg_createsubscriber docs say:

https://www.postgresql.org/docs/17/app-pgcreatesubscriber.html

After a successful run, the state of the target server is analogous
to a fresh logical replication setup. The main difference between
the logical replication setup and pg_createsubscriber is the
initial data copy. It does only the synchronization phase, which
ensures each table is brought up to a synchronized state.

What does "it" and "synchronization phase" mean in "It does only the
synchronization phase"? Seems this needs improvement.

+1 to improve the description.

I think the term "synchronization phase" comes from the description in
"29.8.1. Initial Snapshot" section[1].

https://www.postgresql.org/docs/17/logical-replication-architecture.html#LOGICAL-REPLICATION-SNAPSHOT

How about the following?

The main difference between the logical replication setup and
pg_createsubscriber is how they synchronize table data.
pg_createsubscriber doesn't copy the initial table data because it
uses the tables with their initial data on the target server. It only
does the synchronization phase, which ensures each table is brought up
to a synchronized state by applying changes using standard logical
replication.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

#3Euler Taveira
euler@eulerto.com
In reply to: Masahiko Sawada (#2)
Re: pg_createsubscriber clarification

On Sun, Jul 28, 2024, at 1:17 PM, Masahiko Sawada wrote:

I think the term "synchronization phase" comes from the description in
"29.8.1. Initial Snapshot" section[1].

Yes.

https://www.postgresql.org/docs/17/logical-replication-architecture.html#LOGICAL-REPLICATION-SNAPSHOT

How about the following?

The main difference between the logical replication setup and
pg_createsubscriber is how they synchronize table data.
pg_createsubscriber doesn't copy the initial table data because it
uses the tables with their initial data on the target server. It only
does the synchronization phase, which ensures each table is brought up
to a synchronized state by applying changes using standard logical
replication.

I slightly modified your proposal in the attached patch.

Thoughts?

--
Euler Taveira
EDB https://www.enterprisedb.com/

Attachments:

doc.patchtext/x-patch; name=doc.patchDownload+4-3
#4Bruce Momjian
bruce@momjian.us
In reply to: Euler Taveira (#3)
Re: pg_createsubscriber clarification

Thanks, patch applied to PG 17 and master.

---------------------------------------------------------------------------

On Tue, Jul 30, 2024 at 06:02:51PM -0300, Euler Taveira wrote:

On Sun, Jul 28, 2024, at 1:17 PM, Masahiko Sawada wrote:

I think the term "synchronization phase" comes from the description in
"29.8.1. Initial Snapshot" section[1].

Yes.

https://www.postgresql.org/docs/17/logical-replication-architecture.html#
LOGICAL-REPLICATION-SNAPSHOT

How about the following?

The main difference between the logical replication setup and
pg_createsubscriber is how they synchronize table data.
pg_createsubscriber doesn't copy the initial table data because it
uses the tables with their initial data on the target server. It only
does the synchronization phase, which ensures each table is brought up
to a synchronized state by applying changes using standard logical
replication.

I slightly modified your proposal in the attached patch.

Thoughts?

--
Euler Taveira
EDB https://www.enterprisedb.com/

diff --git a/doc/src/sgml/ref/pg_createsubscriber.sgml b/doc/src/sgml/ref/pg_createsubscriber.sgml
index 87a9d3db28e..6ebf918b636 100644
--- a/doc/src/sgml/ref/pg_createsubscriber.sgml
+++ b/doc/src/sgml/ref/pg_createsubscriber.sgml
@@ -57,9 +57,10 @@ PostgreSQL documentation
<para>
After a successful run, the state of the target server is analogous to a
fresh logical replication setup.  The main difference between the logical
-   replication setup and <application>pg_createsubscriber</application> is the
-   initial data copy.  It does only the synchronization phase, which ensures
-   each table is brought up to a synchronized state.
+   replication setup and <application>pg_createsubscriber</application> is how
+   the data synchronization is done. <application>pg_createsubscriber</application>
+   does not copy the initial table data. It does only the synchronization phase,
+   which ensures each table is brought up to a synchronized state.
</para>

<para>

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.