Re: Reject wholerow references where ColumnRef is forbidden

From: Ishjaap Singh <ishjaap(dot)singh07(at)gmail(dot)com>
To: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-12-04 16:44:14
Message-ID: CA+Y2BmeRhicz-YWKrO4uVn0N=+18ucw8iHT5ETpVa8euQwm7Lw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Paul,

Thanks for the patches. I tested v2 on master and 16, and the nocfbot
patches on 15 and 14. make check passed on those four builds, and v2
also applies to 17, 18 and 19.

On stock master and 14 the cases in your mail crash, and I found a few
more that do too: ROW(t.*)::text, (ROW(t.*)::t).a, a schema-qualified
p.t.*, and a range partition bound. With the patches all of them give
"cannot use column reference" on all four builds. (ROW(1)).f1 and
(ROW((f()).*)).f2 in a DEFAULT still work, and the other cases I tried
(generated columns, CHECK, RETURNING, joins) behave as before.

One small thing: the nocfbot 0001 no longer applies to REL_15_STABLE,
through no fault of the patch. Tom's 5c9da8b0e22 (bug #19906, 11-17)
put the expandNSItemVars() call in coerce_record_to_complex() inside an
"if (pstate)" block, so that hunk just needs reindenting. For 15 I
applied it with git am --ignore-whitespace, which is what I tested. It
still applies to 14 as is, since that commit only went back to 15.

I also went through the other callers of expandNSItemVars() in 14 and
15. The only one without the check is the INSERT ... VALUES one in
analyze.c, which isn't inside an expression, so that looks fine to me.

Rest looks good to me.

Regards,
Ishjaap Singh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-12-04 16:49:02 Re: add --transfer-mode to pg_upgrade
Previous Message Nathan Bossart 2026-12-04 16:31:43 Re: Logical Implication