pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
To: a.kutepow@prodat-sql.de <a.kutepow@prodat-sql.de>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: RE: BUG #18019: misbehaviour by replication
Date: Thu, 13 Jul 2023 08:21:34 +0000
Message-ID: <TYAPR01MB58660F0D9599DA216F9331D4F537A@TYAPR01MB5866.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <18019-21e3fdb5d9057921@postgresql.org>
References: <18019-21e3fdb5d9057921@postgresql.org>

Dear André,

Thanks for the bug report!

We have reproduced the scenario, and slightly simplified the steps and changed
the table/column names to be more generic. Please see the attached script.

You have a PUBLICATION using a row filter “WHERE (should_replicate IS true)”

When you updated that filter column from TRUE to FALSE, we think you hoped that it would not replicate.
But actually this behaviour is correct according to the documentation describing UPDATE Transformations [1]

Specifically “If the old row satisfies the row filter expression (it was sent to the subscriber) but the new row doesn't, then, from a data consistency perspective the old row should be removed from the subscriber. So the UPDATE is transformed into a DELETE.”

[1] https://www.postgresql.org/docs/current/logical-replication-row-filter.html#LOGICAL-REPLICATION-ROW-...

Best Regards,
Hayato Kuroda
FUJITSU LIMITED



Attachments:

  test_rep.sh (application/octet-stream, 1.7K) download

view thread (7+ messages)  latest in thread

Message-ID: <TYAPR01MB58660F0D9599DA216F9331D4F537A@TYAPR01MB5866.jpnprd01.prod.outlook.com>
Permalink:  ../TYAPR01MB58660F0D9599DA216F9331D4F537A@TYAPR01MB5866.jpnprd01.prod.outlook.com/
Also on:    postgresql.org/message-id/TYAPR01MB58660F0D9599DA216F9331D4F537A@TYAPR01MB5866.jpnprd01.prod.outlook.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: kuroda.hayato@fujitsu.com, a.kutepow@prodat-sql.de
  Subject: Re: BUG #18019: misbehaviour by replication
  In-Reply-To: <TYAPR01MB58660F0D9599DA216F9331D4F537A@TYAPR01MB5866.jpnprd01.prod.outlook.com>
  References: <18019-21e3fdb5d9057921@postgresql.org> <TYAPR01MB58660F0D9599DA216F9331D4F537A@TYAPR01MB5866.jpnprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox