On Thu, 31 Oct 2024 at 16:44, Ajin Cherian <itsa...@gmail.com> wrote:
>
>
>
> On Thu, Oct 31, 2024 at 9:55 PM Ajin Cherian <itsa...@gmail.com> wrote:
>>
>> I ran some tests and verified that the patch works with previous versions of 
>> PG12 and PG17
>> 1. Verified with publications with generated columns and without generated 
>> columns on patched code and subscriptions on PG12 and PG17
>> Observations:
>>     a. If publication is created with publish_generated_columns=true or with 
>> generated columns mentioned explicitly, then tablesync will not copy 
>> generated columns but post tablesync the generated columns are replicated
>>     b. Column list override (publish_generated_columns=false) behaviour
>>
>> These seem expected.
>>
>
> Currently the documentation does not talk about this behaviour, I suggest 
> this be added similar to how such a behaviour was documented when the 
> original row-filter version was committed.
> Suggestion:
> "If a subscriber is a pre-18 version, the initial table synchronization won't 
> publish generated columns even if they are defined in the publisher."

The updated patch has the changes for the same.

Regards,
Vignesh
From e9b79f89370ecdb3f08112f61ea95097ed881870 Mon Sep 17 00:00:00 2001
From: Vignesh C <vignes...@gmail.com>
Date: Sun, 3 Nov 2024 18:52:11 +0530
Subject: [PATCH v2] Update Documentation for Generated Columns in Logical
 Replication

This commit enhances the documentation to reflect the recent addition
of support for generated columns in logical replication, as introduced
in commit 745217a051. It clarifies the functionality of generated columns
when used with a column list and outlines changes to initial sync behavior
for subscribers using prior versions.
---
 doc/src/sgml/ddl.sgml                 | 5 +++--
 doc/src/sgml/logical-replication.sgml | 4 +++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index f6344b3b79..f02f67d7b8 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -514,8 +514,9 @@ CREATE TABLE people (
     </listitem>
     <listitem>
      <para>
-      Generated columns are skipped for logical replication and cannot be
-      specified in a <command>CREATE PUBLICATION</command> column list.
+      Generated columns can be replicated during logical replication by
+      including them in the column list of the
+      <command>CREATE PUBLICATION</command> command.
      </para>
     </listitem>
    </itemizedlist>
diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index 98a7ad0c27..d274556b91 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -1436,7 +1436,9 @@ test_sub=# SELECT * FROM child ORDER BY a;
    During initial data synchronization, only the published columns are
    copied.  However, if the subscriber is from a release prior to 15, then
    all the columns in the table are copied during initial data synchronization,
-   ignoring any column lists.
+   ignoring any column lists. If the subscriber is from a release prior to 18,
+   then initial table synchronization won't copy generated columns data even if
+   they are defined in the publisher.
   </para>
 
    <warning id="logical-replication-col-list-combining">
-- 
2.34.1

Reply via email to