pgsql: Replicate generated columns when specified in the column list.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Replicate generated columns when specified in the column list.
Date: 2024-10-30 07:18:58
Message-ID: E1t62yp-0037Oy-F2@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/745217a051a9341e8c577ea59a87665d331d4af0

Modified Files
--------------
doc/src/sgml/protocol.sgml | 4 +-
doc/src/sgml/ref/create_publication.sgml | 3 +-
src/backend/catalog/pg_publication.c | 10 +----
src/backend/replication/logical/proto.c | 63 ++++++++++++++++-------------
src/backend/replication/logical/tablesync.c | 56 +++++++++++++++++--------
src/backend/replication/pgoutput/pgoutput.c | 28 ++++++++-----
src/include/replication/logicalproto.h | 2 +
src/test/regress/expected/publication.out | 6 +--
src/test/regress/sql/publication.sql | 6 ++-
src/test/subscription/t/031_column_list.pl | 41 +++++++++++++++++--
10 files changed, 145 insertions(+), 74 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2024-10-30 07:31:33 pgsql: meson: Add missing dependency to unicode test programs
Previous Message Andrew Dunstan 2024-10-29 23:06:19 Re: pgsql: Update time zone data files to tzdata release 2024b.