| From: | David Rowley <dgrowleyml(at)gmail(dot)com> |
|---|---|
| To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
| Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Fix tuple deformation with virtual generated NOT NULL columns |
| Date: | 2026-06-18 05:18:47 |
| Message-ID: | CAApHDvqrPnvJcTCT6631OHwMbXmP66uOmhrc7-0KG_8kwJ3wPA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, 18 Jun 2026 at 14:36, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
> I tested the fix, and it seems to work. While tracing the code, I wondered about this part:
> ```
> - if (att->attnullability == ATTNULLABLE_VALID &&
> - !att->atthasmissing &&
> - !att->attisdropped)
> + if (attr->attgenerated == ATTRIBUTE_GENERATED_VIRTUAL)
> + break;
> +
> + if (catt->attnullability == ATTNULLABLE_VALID &&
> + !catt->atthasmissing &&
> + !catt->attisdropped)
> guaranteed_column_number = attnum;
> ```
>
> When computing guaranteed_column_number, I think we can just skip the virtual generated column rather than break. Using the test from Tom’s email:
Yeah, I was confused at first as I'd done a similar optimisation in
the non-JIT deform code, but there "guaranteed" means guaranteed to be
present in the tuple data, whereas with the JIT code it means
guaranteed in the tuple data or its NULL bitmap.
I've attached v2 which includes a test that exercises deforming with
tuples which have various natts counts. I propose to backpatch
1f7dfe8c8 to v18 before applying the attached to master and v18.
David
| Attachment | Content-Type | Size |
|---|---|---|
| fix_jit_deform_for_virtual_generated_cols_v2.patch | text/plain | 8.3 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Yugo Nagata | 2026-06-18 05:36:31 | Re: pgbench --continue-on-error: clarify TPS and failure reporting |
| Previous Message | Zsolt Parragi | 2026-06-18 04:54:59 | Re: Require SSL connection to postgres for oauth |