Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wZz1C-001Rud-1O for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jun 2026 22:45:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wZz1A-007yBe-0M for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jun 2026 22:45:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wZz19-007yBW-2d for pgsql-hackers@lists.postgresql.org; Wed, 17 Jun 2026 22:45:55 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wZz17-00000000zNs-2m3H for pgsql-hackers@lists.postgresql.org; Wed, 17 Jun 2026 22:45:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 65HMjndK1174237; Wed, 17 Jun 2026 18:45:49 -0400 From: Tom Lane To: David Rowley cc: Chao Li , Peter Eisentraut , Andres Freund , Postgres hackers Subject: Re: Fix tuple deformation with virtual generated NOT NULL columns In-reply-to: <1151393.1781734980@sss.pgh.pa.us> References: <1151393.1781734980@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 17 Jun 2026 18:23:00 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1174235.1781736349.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 17 Jun 2026 18:45:49 -0400 Message-ID: <1174236.1781736349@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Speculating wildly, I'm wondering about an uninitialized variable that > happens to usually have the right value. Nope: valgrind finds nothing, and neither does debug_discard_caches. What does reproduce it, with seeming 100% reliability, is set jit =3D 1; set jit_above_cost =3D 0; set jit_optimize_above_cost =3D 1000; CREATE TABLE gtest21c (a int NOT NULL, b int GENERATED ALWAYS AS (a * 2) V= IRTUAL NOT NULL, c int NOT NULL); INSERT INTO gtest21c (a, c) VALUES (10, 42); table gtest21c; I conclude that something in the JIT code for tuple formation is unaware of virtual generated columns. regards, tom lane