pgsql: Replicate generated columns when 'publish_generated_columns' is - Mailing list pgsql-committers

From Amit Kapila
Subject pgsql: Replicate generated columns when 'publish_generated_columns' is
Date
Msg-id E1t8tN4-000ZLc-QM@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Replicate generated columns when 'publish_generated_columns' is set.

This patch builds on the work done in commit 745217a051 by enabling the
replication of generated columns alongside regular column changes through
a new publication parameter: publish_generated_columns.

Example usage:
CREATE PUBLICATION pub1 FOR TABLE tab_gencol WITH (publish_generated_columns = true);

The column list takes precedence. If the generated columns are specified
in the column list, they will be replicated even if
'publish_generated_columns' is set to false. Conversely, if generated
columns are not included in the column list (assuming the user specifies a
column list), they will not be replicated even if
'publish_generated_columns' is true.

Author: Vignesh C, Shubham Khanna
Reviewed-by: Peter Smith, Amit Kapila, Hayato Kuroda, Shlok Kyal, Ajin Cherian, Hou Zhijie, Masahiko Sawada
Discussion: https://postgr.es/m/B80D17B2-2C8E-4C7D-87F2-E5B4BE3C069E@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7054186c4ebe24e63254651e2ae9b36efae90d4e

Modified Files
--------------
doc/src/sgml/ddl.sgml                       |   8 +-
doc/src/sgml/protocol.sgml                  |   2 +-
doc/src/sgml/ref/create_publication.sgml    |  20 ++
src/backend/catalog/pg_publication.c        |  73 +++-
src/backend/commands/publicationcmds.c      |  33 +-
src/backend/replication/logical/proto.c     |  69 ++--
src/backend/replication/pgoutput/pgoutput.c | 201 ++++++-----
src/bin/pg_dump/pg_dump.c                   |  41 ++-
src/bin/pg_dump/pg_dump.h                   |   1 +
src/bin/pg_dump/t/002_pg_dump.pl            |  10 +
src/bin/psql/describe.c                     |  20 +-
src/bin/psql/tab-complete.in.c              |   4 +-
src/include/catalog/catversion.h            |   2 +-
src/include/catalog/pg_publication.h        |   7 +
src/include/replication/logicalproto.h      |  21 +-
src/test/regress/expected/psql.out          |   6 +-
src/test/regress/expected/publication.out   | 504 ++++++++++++++++------------
src/test/regress/sql/publication.sql        |  42 +++
src/test/subscription/t/011_generated.pl    | 230 +++++++++++++
src/test/subscription/t/031_column_list.pl  |  34 --
20 files changed, 925 insertions(+), 403 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Improve handling of empty query results in BackgroundPsql::query
Next
From: Michael Paquier
Date:
Subject: pgsql: Remove an obsolete comment in gistinsert()