Re: TupleDescAttr bounds checks
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-03-20T16:28:39Z
Lists: pgsql-hackers
On Fri, Mar 20, 2026 at 12:22 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > Robert Haas <robertmhaas@gmail.com> writes: > > Scrutiny of a recent test_plan_advice failure in the buildfarm > > revealed a bug that had nothing to do with test_plan_advice or > > pg_plan_advice; rather, it was a bug introduced by the virtual > > generated columns feature, and specifically of that feature indexing > > off of the beginning of a TupleDesc when whole-row attributes are > > present. The first patch attached to this email fixes this issue, and > > should be committed and back-patched to v18. I plan to do that soon > > unless there are objections. > > I had just come to the same conclusion about why grison is failing. > +1 to all three of these patches. (I did not look to see if 0002 > fixes every case that the Assert could trigger on, but as long as > you're only putting it in HEAD I'm not too concerned that we might > have missed some.) Hmm, I had a rougher version of this analysis (and an analysis of some the other failures) on an email I sent yesterday on the pg_plan_advice thread. Based on this email and another one you sent, I'm guessing you either didn't see that email or maybe even didn't get a copy of it for some reason. Or maybe you just mean that you were checking over my analysis, but just in case: https://www.postgresql.org/message-id/CA%2BTgmoZUN8FT1Ah%3Dm6Uis5bHa4FUa%2B_hMDWtcABG17toEfpiUg%40mail.gmail.com -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Avoid unsafe access to negative index in a TupleDesc.
- 681a91d29d4d 17.10 landed
- 40fa04e7c851 14.23 landed
- 3c7a6bbe63e2 16.14 landed
- 11c2c0cc8d7c 18.4 landed
- 07e833e3cff3 15.18 landed
-
Disallow system columns in COPY FROM WHERE conditions.
- 21c69dc73f9d 19 (unreleased) landed
-
Add a test for creating an index on a whole-row expression.
- 4647ee2da37c 19 (unreleased) landed
-
Bounds-check access to TupleDescAttr with an Assert.
- c98ad086ad9b 19 (unreleased) landed
-
Prevent spurious "indexes on virtual generated columns are not supported".
- 570e2fcc041a 19 (unreleased) landed
- cceb9c18a50b 18.4 landed