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

From Andres Freund
Subject Re: Fix tuple deformation with virtual generated NOT NULL columns
Date
Msg-id pse3eru75b5skbvc7jjrf7origavqojc6nqtwdrr7z6sjkyxfo@siklvj643v4f
Whole thread
In response to Re: Fix tuple deformation with virtual generated NOT NULL columns  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Fix tuple deformation with virtual generated NOT NULL columns
List pgsql-hackers
Hi,

On 2026-06-06 16:50:29 +1200, David Rowley wrote:
> 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().

Seems like a test for some of this would be good too?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Xuneng Zhou
Date:
Subject: Re: t/035_standby_logical_decoding.pl might fail on attempt to read wrong timeline
Next
From: torikoshia
Date:
Subject: Why is the LSN reported for pg_logical_emit_message() different from other decoded operations?