PS_NITPICKS_20240617_v70001.txt

text/plain

Filename: PS_NITPICKS_20240617_v70001.txt
Type: text/plain
Part: 0
Message: Re: Pgoutput not capturing the generated columns
diff --git a/contrib/test_decoding/expected/decoding_into_rel.out b/contrib/test_decoding/expected/decoding_into_rel.out
index 5ec3f28..2019eb6 100644
--- a/contrib/test_decoding/expected/decoding_into_rel.out
+++ b/contrib/test_decoding/expected/decoding_into_rel.out
@@ -105,8 +105,8 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc
 
 -- check include-generated-columns option with generated column
 CREATE TABLE gencoltable (a int, b int GENERATED ALWAYS AS (a * 2) STORED);
-INSERT INTO gencoltable (a) VALUES (1), (2), (3);
 -- When 'include-generated-columns' is not set
+INSERT INTO gencoltable (a) VALUES (1), (2), (3);
 SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
                             data                             
 -------------------------------------------------------------
@@ -117,7 +117,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc
  COMMIT
 (5 rows)
 
--- When 'include-generated-columns' = '1' the generated column 'b' values will not be replicated
+-- When 'include-generated-columns' = '1' the generated column 'b' values will be replicated
 INSERT INTO gencoltable (a) VALUES (1), (2), (3);
 SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'include-generated-columns', '1');
                             data                             
@@ -129,8 +129,8 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc
  COMMIT
 (5 rows)
 
+-- When 'include-generated-columns' = '0' the generated column 'b' values will not be replicated
 INSERT INTO gencoltable (a) VALUES (4), (5), (6);
--- When 'include-generated-columns' = '0' the generated column 'b' values will be replicated
 SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'include-generated-columns', '0');
                       data                      
 ------------------------------------------------
diff --git a/contrib/test_decoding/sql/decoding_into_rel.sql b/contrib/test_decoding/sql/decoding_into_rel.sql
index 3a04e50..8ad98a0 100644
--- a/contrib/test_decoding/sql/decoding_into_rel.sql
+++ b/contrib/test_decoding/sql/decoding_into_rel.sql
@@ -41,15 +41,15 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc
 
 -- check include-generated-columns option with generated column
 CREATE TABLE gencoltable (a int, b int GENERATED ALWAYS AS (a * 2) STORED);
-INSERT INTO gencoltable (a) VALUES (1), (2), (3);
 -- When 'include-generated-columns' is not set
+INSERT INTO gencoltable (a) VALUES (1), (2), (3);
 SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
--- When 'include-generated-columns' = '1' the generated column 'b' values will not be replicated
+-- When 'include-generated-columns' = '1' the generated column 'b' values will be replicated
 INSERT INTO gencoltable (a) VALUES (1), (2), (3);
 SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'include-generated-columns', '1');
+-- When 'include-generated-columns' = '0' the generated column 'b' values will not be replicated
 INSERT INTO gencoltable (a) VALUES (4), (5), (6);
--- When 'include-generated-columns' = '0' the generated column 'b' values will be replicated
 SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'include-generated-columns', '0');
 DROP TABLE gencoltable;
 
-SELECT 'stop' FROM pg_drop_replication_slot('regression_slot');
\ No newline at end of file
+SELECT 'stop' FROM pg_drop_replication_slot('regression_slot');
diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml
index f072a13..2a70366 100644
--- a/doc/src/sgml/ref/create_subscription.sgml
+++ b/doc/src/sgml/ref/create_subscription.sgml
@@ -434,21 +434,18 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
         <listitem>
          <para>
           Specifies whether the generated columns present in the tables
-          associated with the subscription should be replicated. If the
-          subscriber-side column is also a generated column then this option
-          has no effect; the replicated data will be ignored and the subscriber
-          column will be filled as normal with the subscriber-side computed or
-          default data.
-          <literal>false</literal>.
+          associated with the subscription should be replicated.
+          The default is <literal>false</literal>.
          </para>
-
          <para>
-          This parameter can only be set true if <literal>copy_data</literal> is
-          set to <literal>false</literal>. If the subscriber-side column is also a
-          generated column then this option has no effect; the replicated data will
-          be ignored and the subscriber column will be filled as normal with the
+          If the subscriber-side column is also a generated column then this option
+          has no effect; the subscriber column will be filled as normal with the
           subscriber-side computed or default data.
          </para>
+         <para>
+          This parameter can only be set <literal>true</literal> if <literal>copy_data</literal> is
+          set to <literal>false</literal>.
+         </para>
         </listitem>
        </varlistentry>
       </variablelist></para>