Re: Reject wholerow references where ColumnRef is forbidden

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Reject wholerow references where ColumnRef is forbidden
Date: 2026-10-31 20:24:10
Message-ID: 248969.1793478250@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com> writes:
> Here is a fix to some crashes when using a wholerow reference to sneak
> in a ColumnRef where it shouldn't be allowed.

Good catch, but I really don't like this choice:

> Actually instead of calling it from ExpandColumnRefStar, I'm calling it
> from (one of) its callers, since it isn't always necessary.

That's a recipe for future errors of omission; if someone adds another
call of ExpandColumnRefStar, they might copy the wrong pattern.

Another problem is that I'm not sure that every case of "something.*"
produces Vars; foo().* would not, for example. It might be better to
push the check down to someplace like expandNSItemVars.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Lukas Fittl 2026-10-31 20:21:03 Re: Unify parallel worker handling for index builds and instrumentation