pgsql: Fix double publish of child table's data.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix double publish of child table's data.
Date: 2021-12-09 03:40:24
Message-ID: E1mvAIC-0002A4-L9@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix double publish of child table's data.

We publish the child table's data twice for a publication that has both
child and parent tables and is published with publish_via_partition_root
as true. This happens because subscribers will initiate synchronization
using both parent and child tables, since it gets both as separate tables
in the initial table list.

Ensure that pg_publication_tables returns only parent tables in such
cases.

Author: Hou Zhijie
Reviewed-by: Greg Nancarrow, Amit Langote, Vignesh C, Amit Kapila
Backpatch-through: 13
Discussion: https://postgr.es/m/OS0PR01MB57167F45D481F78CDC5986F794B99@OS0PR01MB5716.jpnprd01.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5e97905a2c764d4ca36f5c6cccd0ebbf157b9df4

Modified Files
--------------
src/backend/catalog/pg_publication.c | 41 +++++++++++--------------------
src/test/regress/expected/publication.out | 8 ++++++
src/test/regress/sql/publication.sql | 4 +++
src/test/subscription/t/013_partition.pl | 18 +++++++++++---
4 files changed, 40 insertions(+), 31 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2021-12-09 05:47:39 Re: pgsql: Check that we have a working tar before trying to use it
Previous Message Andres Freund 2021-12-09 03:08:56 Re: pgsql: Check that we have a working tar before trying to use it