Re: Incorrect messages emitted from pgoutput when using column lists - Mailing list pgsql-bugs

From Amit Kapila
Subject Re: Incorrect messages emitted from pgoutput when using column lists
Date
Msg-id CAA4eK1KpMEQ4P7OVUeWO+ghWYAzmOuwaLvwfuxnKVsTZkVj7EQ@mail.gmail.com
Whole thread Raw
In response to RE: Incorrect messages emitted from pgoutput when using column lists  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
Responses RE: Incorrect messages emitted from pgoutput when using column lists  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
List pgsql-bugs
On Fri, Nov 25, 2022 at 8:16 AM houzj.fnst@fujitsu.com
<houzj.fnst@fujitsu.com> wrote:
>
> I think the reason is that we didn't filter the column when sending the old
> tuple in pgoutput. We thought that the old tuple won't include columns that not
> in RI, but it seems it will still be null values for such columns in the old
> tuple.
>

Yes, that is correct. We do fill null values for non-replica identity
columns in the old tuple. See ExtractReplicaIdentity.

> So, I think we'd better filter the column for old tuple as well.
>

Your fix looks correct to me though I haven't tested it yet.

Can we think of writing a test case using
pg_logical_slot_peek_binary_changes() similar to what we have in
020_messages.pl?

-- 
With Regards,
Amit Kapila.



pgsql-bugs by date:

Previous
From: Joel Mukuthu
Date:
Subject: Re: Unexpected behaviour of a RAISE statement in an IMMUTABLE function
Next
From: "David G. Johnston"
Date:
Subject: Bug or intentionally under-documented "\c databasename;" behavior?