From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Ensure stored generated columns must be published when required.
Date: Wed, 04 Dec 2024 04:27:48 +0000
Message-ID: <E1tIgzL-0010eE-TD@gemulon.postgresql.org> (raw)
Ensure stored generated columns must be published when required.
Ensure stored generated columns that are part of REPLICA IDENTITY must be
published explicitly for UPDATE and DELETE operations to be published. We
can publish generated columns by listing them in the column list or by
enabling the publish_generated_columns option.
This commit changes the behavior of the test added in commit adedf54e65 by
giving an ERROR for the UPDATE operation in such cases. There is no way to
trigger the bug reported in commit adedf54e65 but we didn't remove the
corresponding code change because it is still relevant when replicating
changes from a publisher with version less than 18.
We decided not to backpatch this behavior change to avoid the risk of
breaking existing output plugins that may be sending generated columns by
default although we are not aware of any such plugin. Also, we didn't see
any reports related to this on STABLE branches which is another reason not
to backpatch this change.
Author: Shlok Kyal, Hou Zhijie
Reviewed-by: Vignesh C, Amit Kapila
Discussion: https://postgr.es/m/CANhcyEVw4V2Awe2AB6i0E5AJLNdASShGfdBLbUd1XtWDboymCA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/87ce27de6963091f4a365f80bcdb06b9da098f00
Modified Files
--------------
doc/src/sgml/ref/create_publication.sgml | 8 ++
src/backend/commands/publicationcmds.c | 156 +++++++++++++++++-------------
src/backend/executor/execReplication.c | 39 ++++++--
src/backend/utils/cache/relcache.c | 57 ++++++++---
src/include/catalog/pg_publication.h | 7 ++
src/include/commands/publicationcmds.h | 7 +-
src/test/regress/expected/publication.out | 26 +++++
src/test/regress/sql/publication.sql | 27 ++++++
src/test/subscription/t/100_bugs.pl | 16 +--
9 files changed, 243 insertions(+), 100 deletions(-)
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: Ensure stored generated columns must be published when required.
In-Reply-To: <E1tIgzL-0010eE-TD@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