Re: MERGE bug report

2022-04-12 Thread Alvaro Herrera
On 2022-Apr-11, Richard Guo wrote: > At first I was wondering whether we need to also include vars used in > each action's targetlist, just as what we did for each action's qual. > Then later I realized parse_merge.c already did that. But now it looks > much better to process them two in

Re: MERGE bug report

2022-04-10 Thread Richard Guo
On Sat, Apr 9, 2022 at 5:26 AM Alvaro Herrera wrote: > On 2022-Apr-06, Richard Guo wrote: > > > That's right. The varattno is set to zero for whole-row Var. And in this > > case these whole-row Vars are not included in the targetlist. > > > > Attached is an attempt for the fix. > > Wow, this is

Re: MERGE bug report

2022-04-08 Thread Alvaro Herrera
On 2022-Apr-06, Richard Guo wrote: > That's right. The varattno is set to zero for whole-row Var. And in this > case these whole-row Vars are not included in the targetlist. > > Attached is an attempt for the fix. Wow, this is very interesting. I was surprised that this patch was necessary at

Re: MERGE bug report

2022-04-06 Thread Richard Guo
On Wed, Apr 6, 2022 at 6:18 AM Joe Wildish wrote: > Hello Hackers, > > Reporting a bug with the new MERGE statement. Tested against > 75edb919613ee835e7680e40137e494c7856bcf9. > > psql output as follows: > > ... > psql:merge.sql:33: ERROR: variable not found in subplan target lists > ROLLBACK >

Re: MERGE bug report

2022-04-05 Thread Zhihong Yu
On Tue, Apr 5, 2022 at 3:35 PM Zhihong Yu wrote: > > > On Tue, Apr 5, 2022 at 3:18 PM Joe Wildish wrote: > >> Hello Hackers, >> >> Reporting a bug with the new MERGE statement. Tested against >> 75edb919613ee835e7680e40137e494c7856bcf9. >> >> psql output as follows: >> >> ... >>

Re: MERGE bug report

2022-04-05 Thread Zhihong Yu
On Tue, Apr 5, 2022 at 3:18 PM Joe Wildish wrote: > Hello Hackers, > > Reporting a bug with the new MERGE statement. Tested against > 75edb919613ee835e7680e40137e494c7856bcf9. > > psql output as follows: > > ... > psql:merge.sql:33: ERROR: variable not found in subplan target lists > ROLLBACK >

MERGE bug report

2022-04-05 Thread Joe Wildish
Hello Hackers, Reporting a bug with the new MERGE statement. Tested against 75edb919613ee835e7680e40137e494c7856bcf9. psql output as follows: ... psql:merge.sql:33: ERROR: variable not found in subplan target lists ROLLBACK [local] joe@joe=# \errverbose ERROR: XX000: variable not found in