On Mon, 12 Aug 2024 at 22:03, jian he <jian.universality@gmail.com> wrote:
> AttrNumber ri_RowIdAttNo;
>
> /* arrays of stored generated columns expr states, for INSERT and UPDATE */
> ExprState **ri_GeneratedExprsI;
> ExprState **ri_GeneratedExprsU;
> }
> for the struct ResultRelInfo, i've checked the above fields.
>
> I think first ri_RowIdAttNo applies to MERGE also. so the comments may
> not be correct?
Yeah, ri_RowIdAttNo is used for MERGE. We should fix that comment.
> Other files comments are fine.
I'd say ri_GeneratedExprsI and ri_GeneratedExprsU are also used for
MERGE and the comment for those is also outdated. See:
ExecMergeMatched -> ExecUpdateAct -> ExecUpdatePrepareSlot ->
ExecComputeStoredGenerated(..., CMD_UPDATE)
ExecMergeNotMatched -> ExecInsert -> ExecComputeStoredGenerated(..., CMD_INSERT)
David