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

From Craig Ringer
Subject Re: Logical replication without a Primary Key
Date
Msg-id CAMsr+YGoCo3PKvFp9Q7Qrct3wHoNWRCK4e8U9pAxLevcGjS0cQ@mail.gmail.com
Whole thread Raw
In response to Re: Logical replication without a Primary Key  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-hackers
On 7 December 2017 at 22:32, Joshua D. Drake <jd@commandprompt.com> wrote:

The confusion I have is what if we have two rows that are identical and now that I think about it we would just update both rows, yes? That would make sense because it would produce two updated rows.


I expect so, but honestly, maybe it's easier to just add a pg_regress test to check and demonstrate the behaviour, or do a manual test?

(a pg_regress test would make sense to add anyway, though, and might be easier)

The only ways you could update only one of two identical rows would be if you did so by ctid (since if it were a table with oids, the rows wouldn't be identical anymore). It'd make no sense to send the ctid to the downstream since it'd bear no relationship to the downstream table. I expect it'd probably update both rows. If it doesn't, it probably should.

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

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Logical replication without a Primary Key
Next
From: Petr Jelinek
Date:
Subject: Re: Logical replication without a Primary Key