public inbox for [email protected]
help / color / mirror / Atom feedFrom: =?utf-8?B?Y2NhNTUwNw==?= <[email protected]>
To: =?utf-8?B?Q2hhbyBMaQ==?= <[email protected]>
To: =?utf-8?B?UG9zdGdyZXMgaGFja2Vycw==?= <[email protected]>
Cc: =?utf-8?B?RGF2aWQgUm93bGV5?= <[email protected]>
Subject: Re: Fix tuple deformation with virtual generated NOT NULL columns
Date: Thu, 4 Jun 2026 17:32:17 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
> While testing "Optimize tuple deformation”, I found a bug:
> ```
> evantest=# create table t (a int not null,
> evantest(# g int generated always as (a+1) virtual not null,
> evantest(# b int not null);
> CREATE TABLE
> evantest=# insert into t (a, b) values (10, 20);
> INSERT 0 1
> evantest=# select a, g, b from t;
> a | g | b
> ----+----+---
> 10 | 11 | 0
> (1 row)
> ```
Nice catch! I can reproduce this bug on master. Some comments about the fix:
I find that a virtual generated column is stored as a null in heap tuple, so I think
we should stop setting 'attcacheoff' when we see a virtual generated column in
TupleDescFinalize(), or we will set wrong 'attcacheoff' value. But it seems that
we don't use these wrong value because we can only use 'attcacheoff' up until
the first NULL.
--
Regards,
ChangAo Chen
view thread (22+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Fix tuple deformation with virtual generated NOT NULL columns
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox