Re: support for MERGE - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: support for MERGE
Date
Msg-id 202203091744.o27bb2gpex2j@alvherre.pgsql
Whole thread Raw
In response to Re: support for MERGE  (Zhihong Yu <zyu@yugabyte.com>)
List pgsql-hackers
On 2022-Mar-07, Zhihong Yu wrote:

> For v13-0003-MERGE-SQL-Command-following-SQL-2016.patch :
> 
> +    * Reset per-tuple memory context to free any expression evaluation
> +    * storage allocated in the previous cycle.
> +    */
> +   ResetExprContext(econtext);
> 
> Why is the memory cleanup done in the next cycle ? Can the cleanup be done
> at the end of the current cycle ?

I have removed that, because Andres had already pointed out that it was
redundant with the reset done in the caller.

> +            * XXX Should this explain why MERGE has the same logic as UPDATE?
> 
> I think explanation should be given.

Actually, the routine in question is only handling insert, not UPDATE,
so MERGE is not relevant to the function.  I have removed the comment.
This was probably a leftover from work prior to 86dc90056dfd; that
commit made it all irrelevant.

-- 
Álvaro Herrera              Valdivia, Chile  —  https://www.EnterpriseDB.com/
"Ninguna manada de bestias tiene una voz tan horrible como la humana" (Orual)



pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Proposal: Support custom authentication methods using hooks
Next
From: Justin Pryzby
Date:
Subject: Re: Adding CI to our tree