Re: minor comments issue in ResultRelInfo src/include/nodes/execnodes.h - Mailing list pgsql-hackers

From David Rowley
Subject Re: minor comments issue in ResultRelInfo src/include/nodes/execnodes.h
Date
Msg-id CAApHDvpfSi7kZDLPPXYHP2xfTn9Hgnu2tvawtK2z_Mxhj4hNPg@mail.gmail.com
Whole thread Raw
In response to minor comments issue in ResultRelInfo src/include/nodes/execnodes.h  (jian he <jian.universality@gmail.com>)
Responses Re: minor comments issue in ResultRelInfo src/include/nodes/execnodes.h
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Arseny Sher
Date:
Subject: Re: Taking into account syncrep position in flush_lsn reported by apply worker
Next
From: jian he
Date:
Subject: Re: Remove dependence on integer wrapping