Re: create subscription with (origin = none, copy_data = on)

vignesh C <vignesh21@gmail.com>

From: vignesh C <vignesh21@gmail.com>
To: Sergey Tatarintsev <s.tatarintsev@postgrespro.ru>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-01-18T05:01:27Z
Lists: pgsql-hackers

Attachments

On Fri, 17 Jan 2025 at 21:30, vignesh C <vignesh21@gmail.com> wrote:
>
> On Fri, 17 Jan 2025 at 14:00, Sergey Tatarintsev
> <s.tatarintsev@postgrespro.ru> wrote:
> >
> > Hi, hackers!
> >
> > I am looking at subscription creation command:
> >
> > CREATE SUBSCRIPTION sub CONNECTION '...' PUBLICATION pub WITH (origin =
> > none, copy_data = on);
> >
> > For now we log a warning if the publisher has subscribed to the same
> > table from some other publisher.
> > However, in case of publication with publish_via_partition_root option,
> > we will not raise such warinigs
> > because SQL command in check_publications_origin() checks only directly
> > published tables.
>
> Yes, I agree that we are checking only the directly published tables
> which is why there is no warning in this case. I'm working on a fix to
> change the check_publications_origin to check accordingly.

Attached patch has the fix for this issue which includes the partition
tables also for the publication now and throws a warning
appropriately.

Regards,
Vignesh

Commits

  1. Fix a WARNING for data origin discrepancies.