From 745217a051a9341e8c577ea59a87665d331d4af0 Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Wed, 30 Oct 2024 12:36:26 +0530 Subject: Replicate generated columns when specified in the column list. This commit allows logical replication to publish and replicate generated columns when explicitly listed in the column list. We also ensured that the generated columns were copied during the initial tablesync when they were published. We will allow to replicate generated columns even when they are not specified in the column list (via a new publication option) in a separate commit. The motivation of this work is to allow replication for cases where the client doesn't have generated columns. For example, the case where one is trying to replicate data from Postgres to the non-Postgres database. Author: Shubham Khanna, Vignesh C, Hou Zhijie Reviewed-by: Peter Smith, Hayato Kuroda, Shlok Kyal, Amit Kapila Discussion: https://postgr.es/m/B80D17B2-2C8E-4C7D-87F2-E5B4BE3C069E@gmail.com --- doc/src/sgml/protocol.sgml | 4 ++-- doc/src/sgml/ref/create_publication.sgml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 057c46f3f57..71b6b2a535f 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -6544,7 +6544,7 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;" Next, the following message part appears for each column included in - the publication (except generated columns): + the publication: @@ -7477,7 +7477,7 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;" - Next, one of the following submessages appears for each column (except generated columns): + Next, one of the following submessages appears for each column: diff --git a/doc/src/sgml/ref/create_publication.sgml b/doc/src/sgml/ref/create_publication.sgml index fd9c5deac95..d2cac06fd76 100644 --- a/doc/src/sgml/ref/create_publication.sgml +++ b/doc/src/sgml/ref/create_publication.sgml @@ -89,7 +89,8 @@ CREATE PUBLICATION name When a column list is specified, only the named columns are replicated. - If no column list is specified, all columns of the table are replicated + The column list can contain generated columns as well. If no column list + is specified, all table columns (except generated columns) are replicated through this publication, including any columns added later. It has no effect on TRUNCATE commands. See for details about column -- cgit v1.2.3