Re: [PATCH v1] [BUG #19516] Skip whole-row projection shortcut for OLD/NEW returning type

Dean Rasheed <dean.a.rasheed@gmail.com>

From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Marko Grujic <marko.grujic@enterprisedb.com>
Cc: pgsql-hackers@lists.postgresql.org, Marko Grujic <markoog@gmail.com>
Date: 2026-06-11T11:24:14Z
Lists: pgsql-hackers
On Wed, 10 Jun 2026 at 15:08, Marko Grujic
<marko.grujic@enterprisedb.com> wrote:
>
> > So I think a better solution would be to add a new function
> GetNSItemByVar(), similar to GetNSItemByRangeTablePosn()
>
> Alright, produced a v2 patch with this approach now (attached).
>
> It also fixes the star expansion when RETURNING parenthesized OLD/NEW rows (added test cases to exercise that as well).
>
> Let me know how it looks.
>

Looks good, thanks.

Pushed and back-patched to v18.

I condensed the tests down a bit, and added a comment note to
GetNSItemByRangeTablePosn() suggesting that callers should consider
GetNSItemByVar() instead, in case any new code is written that might
need it.

Regards,
Dean



Commits

  1. Fix parsing of parenthesised OLD/NEW in RETURNING list.