Re: BUG #17670: Logical Replication data may be lost on the subscription under certain scenarios

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: Japin Li <japinli(at)hotmail(dot)com>, xyh(at)nvn(dot)xyz, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17670: Logical Replication data may be lost on the subscription under certain scenarios
Date: 2022-11-02 07:43:02
Message-ID: CAA4eK1LX6TQwNztm7OccEXYUu2FcugY5J3SH-MAn0R+Yho9s1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Oct 31, 2022 at 2:24 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> On Sun, Oct 30, 2022 at 7:22 PM Japin Li <japinli(at)hotmail(dot)com> wrote:
>
> > > I am just wondering if it is correct behavior to allow renaming the
> > > table used by a subscription, or should there be some dependency?
> >
> > Maybe we can add a dependency to make the user know what they are doing.
> > I also want to know when we should add a dependency?
>
> I haven't thought about it in deep, but I think whenever we add a new
> entry to pg_subscription_rel, that time maybe we could add a
> dependency on the respective subscription entry IMHO. But I am just
> wondering is there any reason why we are not already having such
> dependency?
>

As per our current implementation, users need to be careful with DDL
operations on tables involved in subscriptions to ensure smooth
replication. In the example shared in this thread, say if the user
wants to rename tables on both publisher and subscriber then the case
reported would have worked without hassles, and disallowing Alter
Table would have unnecessarily made that operation difficult.
Similarly, say if the user wants to add a primary key on the table on
both publisher and subscriber, then it would be quite easy with the
current system but adding dependencies could be additional work for
the user and some people can complain about the same.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2022-11-02 07:46:30 Re: BUG #17618: unnecessary filter column <> text even after adding index
Previous Message Amit Kapila 2022-11-02 07:21:55 Re: BUG #17670: Logical Replication data may be lost on the subscription under certain scenarios