Re: Fix tuple deformation with virtual generated NOT NULL columns - Mailing list pgsql-hackers

From David Rowley
Subject Re: Fix tuple deformation with virtual generated NOT NULL columns
Date
Msg-id CAApHDvoQKY8zHb1LZBuYZBRszi0qVmTaV_zFup=A9xqRpJWMRQ@mail.gmail.com
Whole thread
In response to Fix tuple deformation with virtual generated NOT NULL columns  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: Fix tuple deformation with virtual generated NOT NULL columns
Re: Fix tuple deformation with virtual generated NOT NULL columns
List pgsql-hackers
On Thu, 4 Jun 2026 at 17:57, Chao Li <li.evan.chao@gmail.com> wrote:
> While testing "Optimize tuple deformation”, I found a bug:

> I think the problem is in finding the first non-guaranteed attribute where virtual generated attributes are not
considered:

Thanks for the report and fix. I pushed a slightly adjusted version.
Form_pg_attribute.attgenerated is '\0' for non-generated columns, so
there's no point in checking cattr->attgenerated as well as that.

I also added an Assert() to help catch any other reason that the
guaranteed column gets set incorrectly again in TupleDescFinalize().

David



pgsql-hackers by date:

Previous
From: "ZizhuanLiu X-MAN"
Date:
Subject: Re: Adjust pg_stat_get_lock() prorows to match lock types
Next
From: Ashutosh Bapat
Date:
Subject: GetBufferDescriptor() being called for local buffers from MarkBufferDirtyHint()