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: Invalidate all partitions for a partitioned table in publication
Date: Wed, 22 Sep 2021 03:03:57 +0000
Message-ID: <E1mSsY9-0000Wu-JI@gemulon.postgresql.org> (raw)

Invalidate all partitions for a partitioned table in publication.

Updates/Deletes on a partition were allowed even without replica identity
after the parent table was added to a publication. This would later lead
to an error on subscribers. The reason was that we were not invalidating
the partition's relcache and the publication information for partitions
was not getting rebuilt. Similarly, we were not invalidating the
partitions' relcache after dropping a partitioned table from a publication
which will prohibit Updates/Deletes on its partition without replica
identity even without any publication.

Reported-by: Haiying Tang
Author: Hou Zhijie and Vignesh C
Reviewed-by: Vignesh C and Amit Kapila
Backpatch-through: 13
Discussion: https://postgr.es/m/OS0PR01MB6113D77F583C922F1CEAA1C3FBD29@OS0PR01MB6113.jpnprd01.prod.outlook.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f09a81f1c08fa5c2fed12bed88d53a11a72ff993

Modified Files
--------------
src/backend/catalog/pg_publication.c      | 82 ++++++++++++++++++++-----------
src/backend/commands/publicationcmds.c    | 57 ++++++++++++---------
src/include/catalog/pg_publication.h      |  3 ++
src/include/commands/publicationcmds.h    |  5 ++
src/test/regress/expected/publication.out | 13 ++++-
src/test/regress/sql/publication.sql      | 11 ++++-
6 files changed, 116 insertions(+), 55 deletions(-)



view thread (3+ messages)

Message-ID: <E1mSsY9-0000Wu-JI@gemulon.postgresql.org>
Permalink:  ../E1mSsY9-0000Wu-JI@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mSsY9-0000Wu-JI@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org
  Subject: Re: pgsql: Invalidate all partitions for a partitioned table in publication
  In-Reply-To: <E1mSsY9-0000Wu-JI@gemulon.postgresql.org>
  References: <E1mSsY9-0000Wu-JI@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