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.98.2) (envelope-from ) id 1xGekn-00000002Xe1-3xqu for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Oct 2026 15:49:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xGekm-0000000F44K-3WF2 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Oct 2026 15:49:24 +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.98.2) (envelope-from ) id 1xGegs-0000000F029-3da8 for pgsql-hackers@lists.postgresql.org; Tue, 13 Oct 2026 15:45:22 +0000 Received: from fout-b5-smtp.messagingengine.com ([202.12.124.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xGegq-00000001tiE-1Di8 for pgsql-hackers@lists.postgresql.org; Tue, 13 Oct 2026 15:45:22 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id BEA991D000C6 for ; Tue, 13 Oct 2026 11:45:17 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Tue, 13 Oct 2026 11:45:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm3; t=1791906317; x= 1791992717; bh=V16STvaLBmCocqK9Zv5sFA52pdXsg8A4KphtxDNiGls=; b=c 6ZEsjvSm7HKXrgHaPl6BAh49E93IIwNDAIem6XM2O5Q8oL0/EGcilDOcMhHZHRBT qjD/C5hYuaZ9ByUFH1Tlt2SXK6evHPD2msfeeWZSWarEwFKy0oiY/Oe4i0X+uYko WY6SinMX2AuNai+YkEaZj37kpmC+pDpoYD8Gte6Ds1hER2DFWPFHzCZ4ioYXkMF/ 6tNF7u2mokmcaEZtoHo/Sh84zy9CyARe/wIBtlCPZ6U2n9EzQidQ4WbGc7WmwIWJ B0KUkhX7q0Ydf8fVYloh5IV2s4WDfHThAzxAHVY20Kg7enbvCRSgdqgZph35zr/J ljl+M/BK+gEP0LlCH3x4w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1791906317; x=1791992717; bh=V 16STvaLBmCocqK9Zv5sFA52pdXsg8A4KphtxDNiGls=; b=aEvd6qLPBDLYDWG5F yCIx0mXdIbzebSdHxluJbMhzovxVi2hcHE5lxVtuSiBMl9VM3c4KnvaKta7j5aYH vQQEV/55gIA0/hk6JdemwfN7VKhzoXrJFLlLRCVbxNryyWy45PRFX5iO0+AN6pAQ yqOaWa9C+ORPpd0DNiZckMtsbQdbax2D1+FlutrT8ncl8KXCpg+NrmwE0OmkIWJD tcWKT2Zt3kow5CUy7DC1goMcaZZKkq+Pvitf+m0TdlJ2BnaPC2bDmwYV5tYTwSDs rrZraJhIrci3rtelnG7d9g8OUrMkoWkNvi0/DmMl6/oAFZWwlivfRhadDYd3EFWK 1JW5Q== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox; action=sign d=kurilemu.de a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1791906317; d=kurilemu.de; mf=PGFsdmhlcnJlQGt1cmlsZW11LmRlPg==; rt=PHBnc3FsLWhhY2tlcnNAbGlzdHMucG9zdGdyZXNxbC5vcmc+; s=fm3:rsa-sha256:vanmZx0YMO24+X6LVM8XOoZ7X4QL/nPSLJcfYgf5kCmpfnY XMSvwjc5Nxh6QN/X/TXje+BILRjyo+2vL5n45OrEEae5wdmb2BDy0fjnu2+Lh1ZP M0+jQ/ErffxeVrMhXrx+8GeKMLt4vL+I61dWOUZt9WWAW0uAApNXkyi0K7HlbkBH v3GeInDLYPSmf29/E6E7Ig0YOZUGvPUiNUSNuq0zJvLMp1qxGaMn2AON+kG6saWT sJuty3URoEbBZ0KMOZokvhToqCJMZaYiT7hOIYuhywX5lCYKfftgLhMzO6IfiQN0 ZKnDMEkSecsZ7JqKfMb3+o6Sng6Z0Gih4qjmj8w==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-disposition,content-transfer-encoding, content-type,date,feedback-id,from,in-reply-to,message-id, mime-version,subject,to; Message-Instance: m=1; h=sha256:rGeNR2KX9KiHFGttdTvfD9L3INvDxXUxCh3pPZe09qM=:xRRIZMIkE6n8HUUMeoyZbp/eihpQkUxE5Up7i37wjNQ=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEimrlvks9y7+6Yb7A9umKMNS3GVic/8i/A78KUPixIE5WU5DApxOIlS9kU0POID/ N6zInMGYp/dHCxjDvfLWCGioznVjnIAFxrHqml4LLlu+1VSGjnGyVcrNqgXAm7oz1toQJ2 mYEYTJU38m/iGR/vz2TdNpf/PXaoIdDOrURVSeg27mStktEBqRobVUvIpXbAuXYiDAKgMs LlWNg1W/ykSFpIm4L3QTbtGs3e1+h4ESY+ZysZ6qdcA55FLHaaxj3G3kFswTSYwbfAKNh1 I4ZYa57J+RmcfC+WbTUnk9sxAEeSAnIZKKwYXWXj1mZMge3IS9njbnaRf53hpn1Fmt36PE YUDT/embJ+qfzS0iKeHPGMoaPTgoiNWIQcpR9mIpuZReP9rMq/aQ2B2tHTkxLaEh3OEx1f AsteR9vQKgsW3lIvi89MhAS74IOiUWjUppK5zInj0pG3prX8mq7NQsADz6k9pwGZ16QIeF HGWE7WFhQ8hiY7TG5l8EyYmT5jZFqAcb9Z6XDR4YKgKWeljJaGk1VXrm1qKLbX1A65C6r/ ZrQDZK+jKBG+OcRClAtGEvhAT0+uP+HLJtF29CtRVZ5aup+dIYjbsP4CZRRTX04rXHOiEV 60KQsDBwQWTUi44aiYHyZyk7Z09I3ffvONsHU9fnQ5BKnoViFoRhcz2oBe1Q X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Oct 2026 11:45:17 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1791906313; bh=xRRIZMIkE6n8HUUMeoyZbp/eihpQkUxE5Up7i37wjNQ=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=2zOqW2b1GsnbFsv82x5PsUakXPwNPGqQjS5ehAm+pKMb2yT3fak/P6rOioHqK8B+N QqFRboda3BEM0gPZT+elx2W//EojLj2gUyYghMzOuFhDv1GGJm8eG4K2kOOvn4IkSo pac3MVYG1tiyOtZodvXVZ5veo/LHANQFcvzLSEitBI258qvGMt0SRLvwt56IiBJaIe AQcQ09x67FmrGUO/mhwWulCXPcKBEhEPjR+zgKfVsZqHZ+csKbT21bxr02k4d42wOt Bp/iSs7w1X7CgoEiRHKX0EOCIk7p5RX+lDAv899f15G2ZZoyE7flbVLGIkOQTDEyAv 0WhAsmoJri/pA== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id B7C33B00198; Tue, 13 Oct 2026 17:45:13 +0200 (CEST) Date: Tue, 13 Oct 2026 17:45:13 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Richard Guo Cc: pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Don't trust NOT NULL on virtual generated columns of partitioned Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Oct-13, Richard Guo wrote: > On Tue, Oct 13, 2026 at 9:43 PM Álvaro Herrera wrote: > > I find this very surprising. Are we sure that it makes sense for a > > partition to have a generating expression that differs from the one in > > the parent table? > > No, I don't think it makes sense for a partition to have a different > virtual generation expression than its parent. I raised this exact > same complaint in [1], the paragraph starting with "Regarding #4", > quoted below: > > Regarding #4, the fix is to not trust NOT NULL on a virtual generated > column of a partitioned table. But I don't like this fix at all. I > think the real problem is that a partition is allowed to have a > different virtual generation expression than its parent. It looks like we reached the same conclusion. I propose we restrict this. Ideally we'd do that at least starting with 19. (I would in fact go even further and say that we should add restrictions to all affected stable branches, and provide SQL scripts that users can run to find and remove those that already exist there.) I don't have a patch though, but I imagine it should be easy. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)