pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Replicate generated columns when specified in the column list.
Date: Wed, 30 Oct 2024 07:18:58 +0000
Message-ID: <E1t62yp-0037Oy-F2@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1t62yp-0037Oy-F2@gemulon.postgresql.org>
Permalink:  ../E1t62yp-0037Oy-F2@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1t62yp-0037Oy-F2@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Replicate generated columns when specified in the column list.
  In-Reply-To: <E1t62yp-0037Oy-F2@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox