PS_NITPICKS_GENCOLS_v370001.txt

text/plain

Filename: PS_NITPICKS_GENCOLS_v370001.txt
Type: text/plain
Part: 0
Message: Re: Pgoutput not capturing the generated columns
diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c
index 6f9e126..365f987 100644
--- a/src/backend/replication/logical/tablesync.c
+++ b/src/backend/replication/logical/tablesync.c
@@ -693,7 +693,7 @@ process_syncing_tables(XLogRecPtr current_lsn)
 }
 
 /*
- * Create list of columns for COPY based on logical relation mapping.
+ * Create a list of columns for COPY based on logical relation mapping.
  * Exclude columns that are subscription table generated columns.
  */
 static List *
@@ -749,7 +749,7 @@ make_copy_attnamelist(LogicalRepRelMapEntry *rel, bool *remotegenlist)
 	}
 
 	/*
-	 * Construct column list for COPY, excluding columns that are subscription
+	 * Construct a column list for COPY, excluding columns that are subscription
 	 * table generated columns.
 	 */
 	for (int i = 0; i < rel->remoterel.natts; i++)
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index d953a1a..6d6032d 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -1073,13 +1073,15 @@ pgoutput_column_list_init(PGOutputData *data, List *publications,
 		Bitmapset  *cols = NULL;
 
 		/*
-		 * Process potential column lists for the following cases: a. Any
-		 * publication that is not FOR ALL TABLES. b. When the publication is
-		 * FOR ALL TABLES and 'publish_generated_columns' is false. FOR ALL
-		 * TABLES publication doesn't have user-defined column lists, so all
-		 * columns will be replicated by default. However, if
-		 * 'publish_generated_columns' is set to false, column lists must
-		 * still be created to exclude any generated columns from being
+		 * Process potential column lists for the following cases:
+		 *
+		 * a. Any publication that is not FOR ALL TABLES.
+		 *
+		 * b. When the publication is FOR ALL TABLES and
+		 * 'publish_generated_columns' is false. FOR ALL TABLES publication doesn't
+		 * have user-defined column lists, so all columns will be replicated by
+		 * default. However, if 'publish_generated_columns' is set to false, column
+		 * lists must still be created to exclude any generated columns from being
 		 * published.
 		 */
 		if (!(pub->alltables && pub->pubgencols))