Re: [HACKERS] REPLICA IDENTITY FULL - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: [HACKERS] REPLICA IDENTITY FULL
Date
Msg-id CAMsr+YHfX3vpm=1pVSxRbQH4Cx8DjqkD066XvFFi6Ex9Ssh--w@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] REPLICA IDENTITY FULL  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: [HACKERS] REPLICA IDENTITY FULL  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 20 June 2017 at 06:53, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> On 6/18/17 23:11, Tatsuo Ishii wrote:
>> While playing around with logical replication, I am confused by the
>> behavior of REPLICA IDENTITY FULL.
>
>> However, if a table has text columns, UPDATE/DELETE replication does
>> not work any more. Am I missing something?
>
> This is apparently because for replica identity full the comparison of
> the search key against the tuple value goes through datumIsEqual(),
> which doesn't work for TOAST values.

Personally I think REPLICA IDENTITY FULL conflates two related things.

One is "record the whole old value of the tuple in xlog so logical
decoding can access it".

Quite separately, there is "treat the full tuple as the replica identity key".

I frequently want to be able to use REPLICA IDENTITY DEFAULT, but also
record the whole old tuple not just keys, so they can be used in
conflict processing etc.


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



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [HACKERS] PATCH: Batch/pipelining support for libpq
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Get stuck when dropping a subscription duringsynchronizing table