On Tue, Oct 19, 2021 at 8:17 AM houzj.fnst@fujitsu.com
<houzj.fnst@fujitsu.com> wrote:
> Thanks for the explanation.
>
> I think one reason that I consider this behavior a bug is that: If we add
> both the root partitioned table and the leaf partition explicitly to the
> publication (and set publish_via_partition_root = on), the behavior of the
> apply worker is inconsistent with the behavior of table sync worker.
>
> In this case, all changes in the leaf the partition will be applied using the
> identity and schema of the partitioned(root) table. But for the table sync, it
> will execute table sync for both the leaf and the root table which cause
> duplication of data.
>
> Wouldn't it be better to make the behavior consistent here ?
I agree with the point, whether we are doing the initial sync or we
are doing transaction streaming the behavior should be the same. I
think the right behavior should be that even if user has given both
parent table and the child table in the published table list, it
should sync it only once, because consider the case where we add a
same table twice e.g (CREATE PUBLICATION mypub FOR TABLE t1,t1;) but
in that case also we consider this table only once and there will be
no duplicate data.
--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com