Replicate generated columns when specified in the column list.
authorAmit Kapila <[email protected]>
Wed, 30 Oct 2024 07:06:26 +0000 (12:36 +0530)
committerAmit Kapila <[email protected]>
Wed, 30 Oct 2024 07:06:26 +0000 (12:36 +0530)
commit745217a051a9341e8c577ea59a87665d331d4af0
tree84dc2a406947b44ebbe9d71214fd024a83413a32
parentf22e436bff779fee4e1ce49733ba5791d4634fb1
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
doc/src/sgml/ref/create_publication.sgml
src/backend/catalog/pg_publication.c
src/backend/replication/logical/proto.c
src/backend/replication/logical/tablesync.c
src/backend/replication/pgoutput/pgoutput.c
src/include/replication/logicalproto.h
src/test/regress/expected/publication.out
src/test/regress/sql/publication.sql
src/test/subscription/t/031_column_list.pl