Minor fixes for couple some comments around MERGE RETURNING - Mailing list pgsql-hackers

From David Rowley
Subject Minor fixes for couple some comments around MERGE RETURNING
Date
Msg-id CAApHDvpqp6vtUzG-_josUEiBGyqnrnVxJ-VdF+hJLXjHdHzsyQ@mail.gmail.com
Whole thread Raw
Responses Re: Minor fixes for couple some comments around MERGE RETURNING
List pgsql-hackers
I noticed that PlannedStmt.hasReturning and hasModifyingCTE have an
outdated comment now that MERGE supports RETURNING (per commit
c649fa24a)

i.e. these two:

> bool hasReturning; /* is it insert|update|delete RETURNING? */

> bool hasModifyingCTE; /* has insert|update|delete in WITH? */

transformWithClause() has:

/* must be a data-modifying statement */
Assert(IsA(cte->ctequery, InsertStmt) ||
   IsA(cte->ctequery, UpdateStmt) ||
   IsA(cte->ctequery, DeleteStmt) ||
   IsA(cte->ctequery, MergeStmt));

pstate->p_hasModifyingCTE = true;

which eventually makes it into PlannedStmt.hasModifyingCTE.

The attached trivial patch fixes these.

David

Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: generic plans and "initial" pruning
Next
From: David Rowley
Date:
Subject: Re: First draft of PG 17 release notes