Re: In logical replication concurrent update of partition key creates a duplicate record on standby.

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: amul sul <sulamul(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: In logical replication concurrent update of partition key creates a duplicate record on standby.
Date: 2018-02-12 23:55:11
Message-ID: 96d55f92-50c6-e8e2-bdf1-d3f3a329af6f@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/8/18 10:54, amul sul wrote:
> Not really, like ExecUpdate for an update of partition key if delete is failed
> then the further insert will be skipped, but you are correct, it might be more
> tricky than I can think -- there is no guarantee that the next insert operation
> which replication worker trying to replicate is part of the update of partition
> key mechanism. How can one identify that an insert operation on one relation is
> related to previously deleting operation on some other relation?

I think you somehow need to stitch this back together in logical
decoding and publish it as an update operation. Otherwise, wrong things
happen. For example, what happens to a publication that is configured
to only publish inserts? What happens to update triggers on the
receiving table? What if the subscriber side is partitioned differently?

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2018-02-13 00:06:47 Re: A space-efficient, user-friendly way to store categorical data
Previous Message Tom Lane 2018-02-12 23:38:36 Re: rename sgml files?