On Tue, Jul 20, 2021 at 9:54 AM Amit Kapila <amit.kapil...@gmail.com> wrote: > > On Mon, Jul 19, 2021 at 4:31 PM Dilip Kumar <dilipbal...@gmail.com> wrote: > > > > On Mon, Jul 19, 2021 at 3:12 PM Amit Kapila <amit.kapil...@gmail.com> wrote: > > > > > > Maybe a second option is to have replication change any UPDATE into > > > > either an INSERT or a DELETE, if the old or the new row do not pass the > > > > filter, respectively. That way, the databases would remain consistent. > > > > Yeah, I think this is the best way to keep the data consistent. > > > > Today, while studying the behavior of this particular operation in > other databases, I found that IBM's InfoSphere Data Replication does > exactly this. See [1]. I think there is a merit if want to follow this > idea. >
As per my initial analysis, there shouldn't be much difficulty in implementing this behavior. We need to change the filter API (pgoutput_row_filter) such that it tells us whether the filter is satisfied by the old row, new row or both and then the caller should be able to make a decision based on that. I think that should be sufficient to turn update to insert/delete when required. I might be missing something here but this doesn't appear to require any drastic changes in the patch. -- With Regards, Amit Kapila.