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 1wVize-0029bZ-0u for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Jun 2026 04:50:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wVizd-00FZCT-0l for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Jun 2026 04:50:45 +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 1wVizc-00FZCL-2m for pgsql-hackers@lists.postgresql.org; Sat, 06 Jun 2026 04:50:44 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wViza-00000001XdE-3HJv for pgsql-hackers@lists.postgresql.org; Sat, 06 Jun 2026 04:50:44 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-45fd464d51fso1436979f8f.3 for ; Fri, 05 Jun 2026 21:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780721441; cv=none; d=google.com; s=arc-20240605; b=cNr87ONpOj+UhgJv1S3qu+AUOQziEa6PDDGXpV6T+D1IFP1/U+pzTxz0HRV28IJO6Y HaFBB19yKOGPqAxIF7Mm+GfRF8d9o1sF4JrhdOyPsJyEkLDTdjwdLTxyjwzzbvnLRb0j kqX1UlfBnQNeG5kJkQUGA4NQdDCmOscCIq/2/prj5lYXK70fxVepFRmLRPzfl49aUqhX eYt+fXhZHLuhNDtaZSt1IKmFC7BH7xdxvYVoblfVb6UPIGfNH0ZZ51GdADza1Q66V5LO eunwV1AmF2ZBQS0+xMm1VJMYNvNVMhycgwoTdmmi4FXHqVo5yvIxg+AyfRmttmfnAxvT NLfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/6zC/NM3J+ZnRWkBVU4HVb+4WEVtNVx0rbzLKMPFoOA=; fh=API7pHFvHz//VzzmsjMiZjVU2agzigd09gVcY4RidXg=; b=ROInm9Hk7pfepBMGDG8cvVBMT9g4RZkVmpNjmqXi5P6P0A+INmBIi6L1sVOnkpeTkR LT8859qfEgdjF+149s144dST6W6RRjNuOOfyNRkuq012NGhIqtJy4aIYDF1D+3pAlDN1 Ol3XI29N/6E7JN84DsSHasLvmURxdtFu5b9hzOl4U4URXVtwE2mfk8ZjrDSTAYCDwDOK JA1bZsYeFSfHfyR8zqx3extAy2DRCpyF1g+msfNlDKBNWP0AHoH1Za/mDNBgJvU5B5Bv QoEanknEe2RAcklg6KDrofbC8UwJIdstT6K7dxkIAW++eM4U4sDawvhbwR06UzoaBJMT KHIQ==; 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=1780721441; x=1781326241; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/6zC/NM3J+ZnRWkBVU4HVb+4WEVtNVx0rbzLKMPFoOA=; b=mpqZ9T15gj02kGmTp9Gjn0itGZXAWLvWcjmqk+akHxwywsWrwkzLNOBltgdb+eNze5 1nnSNm/G8kLZybKpM7dqCfyX/c10D5WtAZx2YKioxfmeCxcvBB+vEd1zu7fSPuKF1RFc wAQJlkV/70g4DL7WFJcAWIdf5WteWnkfrlp7kVbW83XpOdVSPTYSBC2wz1kzs2fBdJI4 yTwEhYIRRuSu399X/Ygze0ExUwi81PiDRueXiWob2HE29tjQGVIME2c3xhAmR7HWFT63 EsWFC3azUihyZPJY+t8Qu165bCYfT8JXdCPVrqOWKKyZNsLRQJ74SfeDpdl625AEduHU C/JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780721441; x=1781326241; h=content-transfer-encoding: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=/6zC/NM3J+ZnRWkBVU4HVb+4WEVtNVx0rbzLKMPFoOA=; b=Nj08LGER4lOOB0OEYgcU6w6PjJveMyYS35JizCXkqga9Exr0QDHSWMSflrItN/z6pb +mRwm+CVFS/KRiPqqCdthKG8dd/8HOyS1KrmiGhK0kA5N85A9YrKqDcyctBD5kfG+iJv hyCT3qgPtRrKlGlETnBZ2M1U0KHzdWqxnID0YmwtKVRt4CqRvwrGVzhFB1LXqRGk1YRi dXLzS9RBMN1qa9BRxsjgl7nv+EiN+uGEV2POrYVL7nfWTypyR10P6pzrfZrUKwHQPQVw By7g5Slir0QCER8ngMchOmM8MHlRRvPLyf3xa7Vk9rgltDCGGiwNpLWE4UCdiYED5neG s4uQ== X-Gm-Message-State: AOJu0YwwpoitArgwrUBmRdUBwuUDEl4C7RyYDm0/toYToAwbfjvYi17r r4ykNFe6kOnvCKxwYJF7s6IBKMwjy/BpR5t4Q6OKyQwPtqtTp0cmzGGRiT8N+CiLllT36/057ov UFk6DHF30ntQKNmZKFMzFvsgq3ZlJN4Q= X-Gm-Gg: Acq92OEzMcGbMPbDtAT09cUYs1PblKbnQjp56TezmGwLN61qR/Jgu8MbYS1THwq+Rve O+C4UDkTjxSIhrONZPKyD7f+uVjde54tf3sEoT86x6/UxgV4x9eBQjR6SkJZH7xfnbhEAOpBSYx eNDfgxDwSp5xh0k4i2d69+vKBLfytEoe+EjZUpc2ozH0oYb2NKzsDH7sqN+M2ZnjJaB0UgKi7m7 LrzRPIO+7bik3jg8HyNtnoVyCFUfaNlC+wbudZd4FhqJDtfMxWPbywLKaEQlVw6hI1oeGz3yNu1 apvv2kCBaXtOtnKGPaNKS6s8tAc1ddMyZKHQfshoiowXVrWai8m5QJSY1W2xBXZIyuet4bh2t5O o/3Pen3H/itcVeTxXBrg= X-Received: by 2002:a05:6000:46d9:b0:45e:ea3a:47d6 with SMTP id ffacd0b85a97d-4603062716dmr6437544f8f.32.1780721440889; Fri, 05 Jun 2026 21:50:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Sat, 6 Jun 2026 16:50:29 +1200 X-Gm-Features: AVVi8Cd5FPxH53d_vVjNgjceKa1ydpN6EAchqYM7EgmJGjoJ__6zerhFDi7S5nY Message-ID: Subject: Re: Fix tuple deformation with virtual generated NOT NULL columns To: Chao Li Cc: Postgres hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 4 Jun 2026 at 17:57, Chao Li wrote: > While testing "Optimize tuple deformation=E2=80=9D, I found a bug: > I think the problem is in finding the first non-guaranteed attribute wher= e virtual generated attributes are not considered: Thanks for the report and fix. I pushed a slightly adjusted version. Form_pg_attribute.attgenerated is '\0' for non-generated columns, so there's no point in checking cattr->attgenerated as well as that. I also added an Assert() to help catch any other reason that the guaranteed column gets set incorrectly again in TupleDescFinalize(). David