pgsql: Update JIT tuple deforming code for virtual generated columns

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Update JIT tuple deforming code for virtual generated columns
Date: 2026-06-19 03:27:10
Message-ID: E1waPss-000wsD-2M@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Update JIT tuple deforming code for virtual generated columns

The JIT deforming code contains an optimization that determines which
columns are guaranteed to exist in the tuple. That's used to allow
skipping of reading the tuple's natts when the code only needs to deform
attributes that are guaranteed to always exist in all tuples. 83ea6c540
missed updating this code to account for VIRTUAL generated columns.
These are stored as NULLs in the tuple, but may be defined as NOT NULL.
This could result in the code thinking more columns are guaranteed to
exist than actually do.

Author: David Rowley <dgrowleyml(at)gmail(dot)com>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Backpatch-through: 18
Discussion: https://postgr.es/m/1151393.1781734980@sss.pgh.pa.us

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e9692de1d6f617031be73251949eae31b29275bd

Modified Files
--------------
src/backend/jit/llvm/llvmjit_deform.c | 36 ++++++++++++++-------
src/test/regress/expected/generated_virtual.out | 42 +++++++++++++++++++++++++
src/test/regress/sql/generated_virtual.sql | 21 +++++++++++++
3 files changed, 87 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-06-19 16:52:16 pgsql: Make pg_mkdir_p() tolerant of a concurrent directory creation.
Previous Message David Rowley 2026-06-19 03:26:40 pgsql: Update JIT tuple deforming code for virtual generated columns