Re: TupleDescAttr bounds checks

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-04-04T14:38:53Z
Lists: pgsql-hackers
I wrote:
> Good catch.  I bet it's possible to trigger the Assert just above,
> too, with a WHERE expression using "t.*".

Oh, scratch that, I didn't read the code just above this loop.
But I bet this loop should throw an error for system columns, too,
since we surely won't have computed those either.

			regards, tom lane



Commits

  1. Avoid unsafe access to negative index in a TupleDesc.

  2. Disallow system columns in COPY FROM WHERE conditions.

  3. Add a test for creating an index on a whole-row expression.

  4. Bounds-check access to TupleDescAttr with an Assert.

  5. Prevent spurious "indexes on virtual generated columns are not supported".