Re: Simplify some codes in pgoutput

2023-03-29 Thread Amit Kapila
On Thu, Mar 30, 2023 at 11:12 AM Peter Smith wrote: > > > > > > > 5. > > > AFAIK, the "if (change->data.tp.oldtuple)" can only be true for UPDATE > > > or DELETE, so the code would be better to include a sanity Assert. > > > > > > SUGGESTION > > > if (change->data.tp.oldtuple) > > > { > > >

Re: Simplify some codes in pgoutput

2023-03-29 Thread Peter Smith
Hi Hou-san, I looked again at v4-0001. On Thu, Mar 30, 2023 at 2:01 PM houzj.f...@fujitsu.com wrote: > > On Thursday, March 30, 2023 9:15 AM Peter Smith wrote: > > ... > > > > 2. > > /* Convert tuple if needed. */ > > if (relentry-> attrmap) > > { > > ... > > } > > > > The "Convert tuple

RE: Simplify some codes in pgoutput

2023-03-29 Thread houzj.f...@fujitsu.com
On Thursday, March 30, 2023 9:15 AM Peter Smith wrote: > > Hi Hou-san, > > I tried to compare the logic of patch v3-0001 versus the original HEAD code. > > IMO this patch logic is not exactly the same as before -- there are > some subtle differences. I am not sure if these differences

Re: Simplify some codes in pgoutput

2023-03-29 Thread Peter Smith
Hi Hou-san, I tried to compare the logic of patch v3-0001 versus the original HEAD code. IMO this patch logic is not exactly the same as before -- there are some subtle differences. I am not sure if these differences represent real problems or not. Below are all my review comments: == 1.

RE: Simplify some codes in pgoutput

2023-03-22 Thread houzj.f...@fujitsu.com
On Monday, March 20, 2023 5:20 pmhouzj.f...@fujitsu.com wrote: > > On Thursday, March 16, 2023 12:30 PM Amit Kapila > wrote: > > > > > On Wed, Mar 15, 2023 at 2:00 PM houzj.f...@fujitsu.com > > wrote: > > > > > > I noticed that there are some duplicated codes in pgoutput_change() > > function

RE: Simplify some codes in pgoutput

2023-03-20 Thread houzj.f...@fujitsu.com
On Friday, March 17, 2023 11:49 AM Peter Smith wrote: > > On Wed, Mar 15, 2023 at 7:30 PM houzj.f...@fujitsu.com > wrote: > > > > Hi, > > > > I noticed that there are some duplicated codes in pgoutput_change() > > function which can be simplified, and here is an attempt to do that. > > Hi

RE: Simplify some codes in pgoutput

2023-03-20 Thread houzj.f...@fujitsu.com
On Thursday, March 16, 2023 12:30 PM Amit Kapila wrote: > > On Wed, Mar 15, 2023 at 2:00 PM houzj.f...@fujitsu.com > wrote: > > > > I noticed that there are some duplicated codes in pgoutput_change() > function > > which can be simplified, and here is an attempt to do that. > > > > For

Re: Simplify some codes in pgoutput

2023-03-16 Thread Peter Smith
On Wed, Mar 15, 2023 at 7:30 PM houzj.f...@fujitsu.com wrote: > > Hi, > > I noticed that there are some duplicated codes in pgoutput_change() function > which can be simplified, and here is an attempt to do that. > > Best Regards, > Hou Zhijie Hi Hou-san. I had a quick look at the 0001 patch.

Re: Simplify some codes in pgoutput

2023-03-15 Thread Amit Kapila
On Wed, Mar 15, 2023 at 2:00 PM houzj.f...@fujitsu.com wrote: > > I noticed that there are some duplicated codes in pgoutput_change() function > which can be simplified, and here is an attempt to do that. > For REORDER_BUFFER_CHANGE_DELETE, when the old tuple is missing, after this patch, we