The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/17/logical-replication-subscription.html
Description:
Hi,
https://www.postgresql.org/docs/17/logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-EXAMPLES
Firstly - a big thank you!
As an Oracle DBA, new to PostgreSQL, and therefore learning all the time,
every time I have reason to consult the PostgreSQL documentation, I'm hugely
impressed with the amount, quality, clarity, and accessibility of the
documentation provided. As a documentaion anorak myself, it brings a big
smile to my face so, as I said, thank you!
Today, I happened to be re-doing, and expanding on, labs on logical
replication, covered on a recently-completed course. I browsed through the
online documentation, (smiled), and started following the examples provided
in "29.2.2. Examples: Set Up Logical Replication."
Having created tables on publisher and subscriber, inserted data on the
publisher, and created publication and subscription, I found my results to
be the exact opposite of those indicated here - "Observe that initial table
data is copied, regardless of the publish operation of the publication.".
My subscriber tables t2 and t3 were emply (as though the (publish =
'truncate') rule had in fact been applied to the initial data).
As a result, having inserted the second set of data, my tables now look like
this:
=================
= Publisher
=================
postgres=# INSERT INTO t1 VALUES (4, 'four'), (5, 'five'), (6, 'six');
INSERT 0 3
postgres=# INSERT INTO t2 VALUES (4, 'D'), (5, 'E'), (6, 'F');
INSERT 0 3
postgres=# INSERT INTO t3 VALUES (4, 'iv'), (5, 'v'), (6, 'vi');
INSERT 0 3
postgres=# SELECT * FROM t1;
a | b
---+-------
1 | one
2 | two
3 | three
4 | four
5 | five
6 | six
(6 rows)
postgres=# SELECT * FROM t2;
c | d
---+---
1 | A
2 | B
3 | C
4 | D
5 | E
6 | F
(6 rows)
postgres=# SELECT * FROM t3;
e | f
---+-----
1 | i
2 | ii
3 | iii
4 | iv
5 | v
6 | vi
(6 rows)
=================
= Subscriber
=================
postgres=# SELECT * FROM t1;
a | b
---+-------
1 | one
2 | two
3 | three
4 | four
5 | five
6 | six
(6 rows)
postgres=# SELECT * FROM t2;
c | d
---+---
(0 rows)
postgres=# SELECT * FROM t3;
e | f
---+---
(0 rows)
Have I misunderstood something, perhaps inadvertantly mis-configured some
obscure parameter, or (please no!) is the documentation incorrect?
Thanks in advance for any guidance you're able to offer.
Regards,
Jes