HEAD_v13-0002-Add-clarification-for-the-behaviour-of-the-publi.patch

application/octet-stream

Filename: HEAD_v13-0002-Add-clarification-for-the-behaviour-of-the-publi.patch
Type: application/octet-stream
Part: 1
Message: RE: Data is copied twice when specifying both child and parent table in publication

Patch

Format: format-patch
Series: patch v13-0002
Subject: Add clarification for the behaviour of the publication parameter publish_via_partition_root
File+
doc/src/sgml/ref/create_publication.sgml 7 0
From 1f790afa528780cc528e4940996af5e2a9b15294 Mon Sep 17 00:00:00 2001
From: wangw <wangw.fnst@fujitsu.com>
Date: Wed, 28 Sep 2022 14:35:41 +0800
Subject: [PATCH v13 2/2] Add clarification for the behaviour of the
 publication parameter publish_via_partition_root

The following usage scenarios are not described in detail in the manual:
If one subscription subscribes multiple publications, and these publications
publish a partitioned table and its partitions respectively. When we specify
this parameter on one or more of these publications, which identity and schema
should be used to publish the changes?

In these cases, I think the parameter publish_via_partition_root behave as
follows:

[publisher-side]
create table parent (a int primary key) partition by range (a);
create table child partition of parent default;

create publication pub1 for table parent;
create publication pub2 for table child;

[subscriber-side]
create subscription sub connection 'xxxx' publication pub1, pub2;

- If the parameter publish_via_partition_root is specified only in pub1,
changes will be published using the identity and schema of the table parent.

- If the parameter publish_via_partition_root is specified only in pub2,
changes will be published using the identity and schema of the table child.
---
 doc/src/sgml/ref/create_publication.sgml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/doc/src/sgml/ref/create_publication.sgml b/doc/src/sgml/ref/create_publication.sgml
index c5190f0ce6..a4f84bfa83 100644
--- a/doc/src/sgml/ref/create_publication.sgml
+++ b/doc/src/sgml/ref/create_publication.sgml
@@ -201,6 +201,13 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable>
           consisting of a different set of partitions.
          </para>
 
+         <para>
+          If a root partitioned table is published by any subscribed publications which
+          set publish_via_partition_root = true, changes on this root partitioned table
+          (or on its partitions) will be published using the identity and schema of this
+          root partitioned table rather than that of the individual partitions.
+         </para>
+
          <para>
           This parameter also affects how row filters and column lists are
           chosen for partitions; see below for details.
-- 
2.23.0.windows.1