Re: BUG #17670: Logical Replication data may be lost on the subscription under certain scenarios - Mailing list pgsql-bugs

From Amit Kapila
Subject Re: BUG #17670: Logical Replication data may be lost on the subscription under certain scenarios
Date
Msg-id CAA4eK1LX6TQwNztm7OccEXYUu2FcugY5J3SH-MAn0R+Yho9s1w@mail.gmail.com
Whole thread Raw
In response to Re: BUG #17670: Logical Replication data may be lost on the subscription under certain scenarios  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-bugs
On Mon, Oct 31, 2022 at 2:24 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:
>
> On Sun, Oct 30, 2022 at 7:22 PM Japin Li <japinli@hotmail.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.



pgsql-bugs by date:

Previous
From: Amit Kapila
Date:
Subject: Re: BUG #17670: Logical Replication data may be lost on the subscription under certain scenarios
Next
From: Richard Guo
Date:
Subject: Re: BUG #17618: unnecessary filter column <> text even after adding index