Re: Logical replication without a Primary Key - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: Logical replication without a Primary Key
Date
Msg-id 80dc1847-0c51-44f0-5d1c-60b93a745df8@2ndquadrant.com
Whole thread Raw
In response to Re: Logical replication without a Primary Key  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-hackers
On 18/12/17 21:57, Joshua D. Drake wrote:
> On 12/18/2017 12:52 PM, Andres Freund wrote:
>>
>> Just ot make sure: You're saying there's no problem here, and that
>> logical rep is behaving correctly, right?
> 
> Correct. I am not sure where the miscommunication was (fully willing to
> accept it was on my side) but if I update multiple rows in a single
> statement, all the rows that were modified get replicated. That is the
> behavior I would have expected.
> 

I think it's because we said if you update single row on upstream which
may be confusing in case of multiple rows. It will update single row on
downstream even though there is 4 same rows on downstream. That's still
true. In your test however you have 4 same rows on downstream but you
also have same 4 rows on upstream which you all updated. So you got 4
row updates which were replicated and each of those 4 updates changed
one row.

-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Logical replication without a Primary Key
Next
From: Masahiko Sawada
Date:
Subject: Re: BUG #14941: Vacuum crashes