On Wed, Nov 3, 2021 at 3:43 PM Amit Kapila <amit.kapil...@gmail.com> wrote: > > On Thu, Oct 28, 2021 at 1:55 PM Amit Langote <amitlangot...@gmail.com> wrote: > > > > > > Thanks for the summary, Hou-san, and sorry about my late reply. > > > > I had thought about this some last week and I am coming around to > > recognizing the confusing user experience of the current behavior. > > Though, I am not sure if removing partitions from the result of > > pg_publication_tables view for pubviaroot publications is acceptable > > as a fix, because that prevents replicating into a subscriber node > > where tables that are partition root and a partition respectively on > > the publisher are independent tables on the subscriber. > > > > But we already do that way when the publication is "For All Tables". > Anyway, for the purpose of initial sync, it will just replicate the > same data in two different tables if the corresponding tables on the > subscriber-side are non-partitioned which I am not sure is what the > user will be expecting. >
On further thinking about this, I think we should define the behavior of replication among partitioned (on the publisher) and non-partitioned (on the subscriber) tables a bit more clearly. - If the "publish_via_partition_root" is set for a publication then we can always replicate to the table with the same name as the root table in publisher. - If the "publish_via_partition_root" is *not* set for a publication then we can always replicate to the tables with the same name as the non-root tables in publisher. Thoughts? -- With Regards, Amit Kapila.