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 1wXtUu-003Xky-2O for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Jun 2026 04:28:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wXtTt-000ooK-1e for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Jun 2026 04:26:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wXtTt-000ooC-0i for pgsql-hackers@lists.postgresql.org; Fri, 12 Jun 2026 04:26:57 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wXtTr-00000002Hqn-1TCw for pgsql-hackers@lists.postgresql.org; Fri, 12 Jun 2026 04:26:56 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-46015dc517aso354252f8f.2 for ; Thu, 11 Jun 2026 21:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781238412; cv=none; d=google.com; s=arc-20240605; b=VzC90Tf8kzH6bk8mTct10XTXF4lCnS/umr+GiRoRL8MTfgHZRQ8SLyaNO6Yonhg08h u51zyjFh7Tvld2h6SzPwTqL67jIGCHvLvhrcVVciWEdlqRDxtEabbrdqYIlNOZ2gDuZH z9Mvy5KMt1tZknBpcqShlrGLMLhSWB4IsY/XKDmk1nJbQQ+dWmzXbSB9QbPttAQJ+x09 S3X7Ld4s/XS1t41kKmUwsilsbZErF+9MsuiktZ6cFZHtwdA4jreMZmOXAxPaztWKZHjp k2gXiglGpG8bBDOVVJ7YexIKeR58uZSA2BM772T5HcC6kG176SarzJuhXQEKm8FaH8cT 6ftw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=XTWVSgb8cntu6ikkqm3cr6MG22kBej4+IJc4ubdSDFc=; fh=hjbcHoCdMCv5Y10rLW1zzHNG+tAgV/xefNZqgYkbwuU=; b=Xqv7bzDeyDubYW4eyc0LlUlwnJRgcWQG2Akq/hFXV61OfRnJ6WjUHH21jIpgXldwbe hNFq8kTBtgN++lT8WsGs3BNQ4uEtGoe+vwzsix2LbrOURjzdwaVzIMamnXEejF2UDWts kBuxSCGThLfL3n/Gq7DbtL7o1MYtVeYrsJX/GEZIUdYPEwmtIQYyLcVKI4afsd8jmbBm V9WZWGhkORvE4+NVFvWmfPAKlRin7Otchc+4pYixW/YS7TRnc6Vb9zYAMJ0Lg5Yl3hq3 6tFYBGPtPRb4v9mSERvjiN7BPEdQdw9G/bVzFWhQqm31YegtXDeyHM6URS0pluh7DZQr wRqA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781238412; x=1781843212; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XTWVSgb8cntu6ikkqm3cr6MG22kBej4+IJc4ubdSDFc=; b=ZgjO83Cdn/Hq9pfgXII68D5C9SSSCUqCKP/KuAruC+pkf4dMoGKkjZhp8ljbMNoRX6 DajGbHJ4AMuAlfhkcJu0MWuAgw5SlODRcefPaA3sjFtIPqRgG4ysRfsk626i+bWOVsNW JpvBB2v4DeHjbFRic2bJlPRAP8PqvwLFDBPBrDL110+mRHv+uanAXcmppYZ6giDHv4Gz gXwQ6/Zj0ysZ5gP1g5z04GcyekusclNSttxiV8hbDmfLAfyFD2qKJtiJ3bnO9gkT16UV Ppg8UryKOuFS2k6/IJGkceoediCdNiq9+6lCFi6POAFzrgoVxGu1hmAdglOyXvRrf9vs jiFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781238412; x=1781843212; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XTWVSgb8cntu6ikkqm3cr6MG22kBej4+IJc4ubdSDFc=; b=SWZCBpnAEmrRGa3picn4lUA9agyOno1jG2WY7XWYbP4ONLNmF3iW2BbO+ifY8l7G59 abkZ7ZBGmya8GeXgZwf4rvKgJUOpMVZYgAkF7in+ZXfcN/hU/I66Ms5+kOc2JhjWxjGl /JdVzfiXwhWSX7MvCXq15XiFnVVGenDKzesOaP3VAfr2A2Ng24Feq1BjM2YuEK9oiMPQ vEkYzMIgN+T4SXl/ySW6eqzwFqPgBSx9ahn94M48AJgD15sEad15+CZ/CWDkaK8QBdSG 4CY0lzKpurgSP5xKw5u7cJ2qBDG30AYi6P9YfnlRB826IrASaWEFGvDSKHmRfvWcN1Ho ykRA== X-Forwarded-Encrypted: i=1; AFNElJ+tpdZoj9wgsdkRBqSd0HsP4pdigYfBWFiH4l7RlXEKgzItstq2bazmeKvio2I+If0my4EueUbyQmYGd4rR@lists.postgresql.org X-Gm-Message-State: AOJu0YywvJNPNGsv4JjP07M2T+cwFNinvx3OhPItuv+Do5nQFxBTPd/5 ecV13cObiXNuI56WGc5WgTbH6YJTeHK4gC0B3wsfagn+vjezKDXpkTufvkoUn0IykM+z6OjKguX W9WWVdyGxFpODDI8wK78L516G9I7IcAA= X-Gm-Gg: Acq92OGvh+H+gNqmDQ6725FWwCzHZdhUrDFiQDY3yrk3Qu1zB1yCVZjzdGH9y4l2hoA f074UrRNZbG6klIC5Hz5gSPuh2NpwcyXMNAdqPrktRFUwvnuoGFY6FDTloIiVapyJMn7NHqdqPz 3ut7U5+Im0jxtBsu7R0+THjmEGc7PmfGsMuA30GaOv+H5+PqUOBDwfMvgjiZcqNPJnUmwEJFq2i DwTc8ysytUJOwQKIWpn0Ata/ZTkZLpipjDShxqXamKFbNpDgkqnTxTKYfIs0adiNCxZ7kxcwizu LE1sgPQ5utfXS+oj2/z2FOm/rH669PwERnh9JuSD32upYrO4myvw5tKJS8SMaofhoN6eKRz1 X-Received: by 2002:a05:6000:43c5:10b0:44a:be4:d0e4 with SMTP id ffacd0b85a97d-4606db97920mr971234f8f.25.1781238412294; Thu, 11 Jun 2026 21:26:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Fri, 12 Jun 2026 16:26:41 +1200 X-Gm-Features: AVVi8CdtGXCbjeRjWol4uAs6Mg-odHcsEq581fseHaQ6JEIhSvdp4VcrxItkQSw Message-ID: Subject: Re: Fix tuple deformation with virtual generated NOT NULL columns To: Chao Li , Peter Eisentraut Cc: Andres Freund , Postgres hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 9 Jun 2026 at 14:20, Chao Li wrote: > > On Jun 8, 2026, at 21:01, Andres Freund wrote: > > Seems like a test for some of this would be good too? > Okay, I tried to add a test matching my repro. With this test in place, I reverted the fix and ran make check; it failed by hitting the Assert David added: > ``` > TRAP: failed Assert("first_null_attr(tup->t_bits, natts) >= firstNullAttr"), File: "execTuples.c", Line: 1083, PID: 65804 I was on the fence about that test as I felt it was mostly highlighting that there was a bug once with that particular case, and didn't feel like it did much to prevent future omissions from TupleDescFinalize(). I felt the Assert would help highlight future stuff. However, I don't object to adding the test if others feel it's worthwhile, but on looking at the patch, there are a couple of things that stand out. 1. Nothing has been done for the comment at the top of the file that says "-- keep these tests aligned with generated_stored.sql". It looks like there have been quite a few commits already which have neglected this. Maybe that means we should do away with the comment rather than try to align the two. 2. I can't quite figure out the pattern in these tests for dropping vs not dropping the tables at the end of the test. Many tests do DROP TABLE and a large number of others don't bother. What's meant to be happening here? I've added Peter as I think it was his intention to keep these tests aligned with generated_stored.sql. David