Update Examples in Logical Replication Docs

Started by Shlok Kyal6 months ago3 messages
#1Shlok Kyal
shlok.kyal.oss@gmail.com
1 attachment(s)

Hi,

While going through the example for column lists [1]https://www.postgresql.org/docs/current/logical-replication-col-lists.html and row filters
[2]: https://www.postgresql.org/docs/current/logical-replication-row-filter.html
updated as per PostgreSQL 18. In PG 18, a new column "Generated
columns' was added in "\dRp+" by commit [3]https://github.com/postgres/postgres/commit/7054186c4ebe24e63254651e2ae9b36efae90d4e, so I think we should
update the docs to reflect the same. I have attached a patch with the
changes.
The changes apply to both the branches REL_18_STABLE and HEAD.

[1]: https://www.postgresql.org/docs/current/logical-replication-col-lists.html
[2]: https://www.postgresql.org/docs/current/logical-replication-row-filter.html
[3]: https://github.com/postgres/postgres/commit/7054186c4ebe24e63254651e2ae9b36efae90d4e

Thanks,
Shlok Kyal

Attachments:

v1-0001-Update-examples-in-logical-replication-docs.patchapplication/octet-stream; name=v1-0001-Update-examples-in-logical-replication-docs.patchDownload
From cf5d28652dbe896a95939e5b72dec05b48134f45 Mon Sep 17 00:00:00 2001
From: Shlok Kyal <shlok.kyal.oss@gmail.com>
Date: Mon, 21 Jul 2025 22:40:19 +0530
Subject: [PATCH v1] Update examples in logical replication docs

Defination of \dRp+ was changed by commit 03b08c8. This patch updates
the examples of column list and row filter to reflect this change.
---
 doc/src/sgml/logical-replication.sgml | 42 +++++++++++++--------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index e26f7f59d4a..48edb35a260 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -1048,28 +1048,28 @@ HINT:  To initiate replication, you must manually create the replication slot, e
     defined) for each publication.
 <programlisting><![CDATA[
 /* pub # */ \dRp+
-          Publication p1
-  Owner   | All tables | Inserts | Updates | Deletes | Truncates | Via root
-----------+------------+---------+---------+---------+-----------+----------
- postgres | f          | t       | t       | t       | t         | f
+                                         Publication p1
+  Owner   | All tables | Inserts | Updates | Deletes | Truncates | Generated columns | Via root
+----------+------------+---------+---------+---------+-----------+-------------------+----------
+ postgres | f          | t       | t       | t       | t         | none              | f
 Tables:
- "public.t1" WHERE ((a > 5) AND (c = 'NSW'::text))
+    "public.t1" WHERE ((a > 5) AND (c = 'NSW'::text))
 
-          Publication p2
-  Owner   | All tables | Inserts | Updates | Deletes | Truncates | Via root
-----------+------------+---------+---------+---------+-----------+----------
- postgres | f          | t       | t       | t       | t         | f
+                                         Publication p2
+  Owner   | All tables | Inserts | Updates | Deletes | Truncates | Generated columns | Via root
+----------+------------+---------+---------+---------+-----------+-------------------+----------
+ postgres | f          | t       | t       | t       | t         | none              | f
 Tables:
- "public.t1"
- "public.t2" WHERE (e = 99)
+    "public.t1"
+    "public.t2" WHERE (e = 99)
 
-          Publication p3
-  Owner   | All tables | Inserts | Updates | Deletes | Truncates | Via root
-----------+------------+---------+---------+---------+-----------+----------
- postgres | f          | t       | t       | t       | t         | f
+                                         Publication p3
+  Owner   | All tables | Inserts | Updates | Deletes | Truncates | Generated columns | Via root
+----------+------------+---------+---------+---------+-----------+-------------------+----------
+ postgres | f          | t       | t       | t       | t         | none              | f
 Tables:
- "public.t2" WHERE (d = 10)
- "public.t3" WHERE (g = 10)
+    "public.t2" WHERE (d = 10)
+    "public.t3" WHERE (g = 10)
 ]]></programlisting></para>
 
    <para>
@@ -1491,10 +1491,10 @@ Publications:
      for each publication.
 <programlisting>
 /* pub # */ \dRp+
-                               Publication p1
-  Owner   | All tables | Inserts | Updates | Deletes | Truncates | Via root
-----------+------------+---------+---------+---------+-----------+----------
- postgres | f          | t       | t       | t       | t         | f
+                                         Publication p1
+  Owner   | All tables | Inserts | Updates | Deletes | Truncates | Generated columns | Via root
+----------+------------+---------+---------+---------+-----------+-------------------+----------
+ postgres | f          | t       | t       | t       | t         | none              | f
 Tables:
     "public.t1" (id, a, b, d)
 </programlisting></para>
-- 
2.34.1

#2Peter Smith
smithpb2250@gmail.com
In reply to: Shlok Kyal (#1)
Re: Update Examples in Logical Replication Docs

On Tue, Jul 22, 2025 at 3:27 AM Shlok Kyal <shlok.kyal.oss@gmail.com> wrote:

Hi,

While going through the example for column lists [1] and row filters
[2] in logical replication, I found that the output of "\dRp+" is not
updated as per PostgreSQL 18. In PG 18, a new column "Generated
columns' was added in "\dRp+" by commit [3], so I think we should
update the docs to reflect the same. I have attached a patch with the
changes.
The changes apply to both the branches REL_18_STABLE and HEAD.

Good catch. The patch LGTM (by inspection only -- I did not try it).

Note there is a typo in the commit message:
/Defination/Definition/

======
Kind Regards,
Peter Smith.
Fujitsu Australia

#3Amit Kapila
amit.kapila16@gmail.com
In reply to: Shlok Kyal (#1)
Re: Update Examples in Logical Replication Docs

On Mon, Jul 21, 2025 at 10:57 PM Shlok Kyal <shlok.kyal.oss@gmail.com> wrote:

While going through the example for column lists [1] and row filters
[2] in logical replication, I found that the output of "\dRp+" is not
updated as per PostgreSQL 18. In PG 18, a new column "Generated
columns' was added in "\dRp+" by commit [3], so I think we should
update the docs to reflect the same. I have attached a patch with the
changes.
The changes apply to both the branches REL_18_STABLE and HEAD.

Thanks for the report and patch. I'll take care of it.

--
With Regards,
Amit Kapila.