RE: Incorrect messages emitted from pgoutput when using column lists

From: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Gunnar Morling <gunnar(dot)morling(at)googlemail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: RE: Incorrect messages emitted from pgoutput when using column lists
Date: 2022-11-27 12:42:51
Message-ID: OS0PR01MB57164F0D0219D50774BFBA4994109@OS0PR01MB5716.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Friday, November 25, 2022 10:53 AM Michael Paquier <michael(at)paquier(dot)xyz>
>
> On Fri, Nov 25, 2022 at 02:46:46AM +0000, houzj(dot)fnst(at)fujitsu(dot)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. So, I think we'd better filter the column for old
> tuple as well.
>
> Isn't that something where you should have at least some coverage with one or
> more regression tests?

Yes, I agree. Since the UPDATE will succeed even if old tuple includes columns
not in the column list, it took me a while to think of another test approach.
In the new version patch[1], I try to use pg_logical_slot_peek_binary_changes() to
get the binary data of UPDATE and test the number of columns in the old tuple.

[1] https://www.postgresql.org/message-id/OS0PR01MB571658F178388836D116217A94109%40OS0PR01MB5716.jpnprd01.prod.outlook.com

Best regards,
Hou zj

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David E. Wheeler 2022-11-27 22:47:53 Re: BUG #17694: In JSONPath expressions, characters between leading $ and dot appear to be ignored
Previous Message houzj.fnst@fujitsu.com 2022-11-27 12:37:07 RE: Incorrect messages emitted from pgoutput when using column lists