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 1vmzWE-0010cL-2u for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Feb 2026 19:23:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vmzVD-000u3g-2G for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Feb 2026 19:22:27 +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 1vmzVC-000u3X-2a for pgsql-bugs@lists.postgresql.org; Mon, 02 Feb 2026 19:22:27 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vmzV9-00000000iIy-06GZ for pgsql-bugs@lists.postgresql.org; Mon, 02 Feb 2026 19:22:26 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 688221D00049; Mon, 2 Feb 2026 14:22:20 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Mon, 02 Feb 2026 14:22:20 -0500 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=fm1; t=1770060140; x= 1770146540; bh=qx0LHQjd63xVA+8freBFJxwIeqxapMCBp5G3yPxqUK4=; b=j io+ygB4UMR1SYvsdeHj6Tw7uw7RXS6yvy/Ka5mEDu55voDmR+mz3xgoi5lD3r657 B4ttvSRyI424hrhPk8qdM0MSQopBBI59hx2Cdv1JlmrjWYWzkFjXiCE/qlyvYII9 GBozhbFmVtRaLwB3TtNpVGHrvKP52T6IFeKEgwLRMn0vqWMsKdkvq5oUxbEq8Xbf MhjYVVwaGwr0KaHH7cvmbyJmvSGGx9tc7zL/R+uRovahAtHk8+PKkTBZm0LpSeZ2 d1vVRyslCIL6mBN8Hp+p+goHu5P+OQvnpp71o0QOx3zndl6qnoFO6pQDZbblZ0ev /0bxPlZAs01C7gWg1WVzQ== 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=fm3; t=1770060140; x=1770146540; bh=q x0LHQjd63xVA+8freBFJxwIeqxapMCBp5G3yPxqUK4=; b=EnCiNhGW+ONeArJ/z Fq+G/zNU0hu3XHdidAVOtU+hwUsbZen/LbD3iiHU5r48rMiHLRn8jy30WJsb2MO2 N5ovbZmJEx33xaymYRdr/OxJi/m166lf/woVmwMaDB1iH/bvE9AYtNZhDUggapQ2 18jZYpkE1dIy9s2eBjHLsjPQkeIdI4s4FfPpbWtclUw4Z9XvRWdKesA84gE/1HMn oMefkjxn2SaaMVSkdcyBqkt/3M71yX9cD5ppN21wwgXCvV0CX4vm+XyEVqii2S4A LrYQhtqu3IwBWSlEx0z5CuaVeZI5u5FDTHGO/SJdyScYeaGvZtBROU3+iPMgEPOO v4fbQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddujeekgeeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesmhekreertddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeegudetudejheduveevgeehjeegleevveevvdeutdejtdekuefhheeh geevtdejteenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehmshgunhgthhhinhgrseduieefrdgtohhmpdhrtghpthhtohep shhrihhnrghthhdvudeffeesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqd gsuhhgsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 Feb 2026 14:22:19 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1770060137; bh=n4MMGIyO7qQUJUqiilrbxH3rDJkCkAoUo5KSRDk3Q8o=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=JGOdxVOuQLtl6+1vmwyEhx6iTm1f5btebsViFpJwp4Lyf9GqJ9dG8KwdbcYFTmrHP P0R8LwFDkcdqQx02BivPY/z6Cb+WKF9gmNfYteUf7YuVWmK5UTtbEjnphYyg6/xFbi vN9xfagUXH0Eqw6XQ1X9DY+LvO4fNB/c2wYFUdDZT6QqNmvjKxRQ2g9p4/lWEP+Jqq mCZnGuNR8tZPHNJmACgutLobDOaomquaWnr8WIrtdAgOi2GhMZYDfr7Zyksv6YvCcK 9hYVnCEhhsJZ6Py+TQObmWnQpQf6yrOR4KJPCeWHvcLaCLmInTgZTRtdx5phY13l9Z r6A7ZQbVSFO3g== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 1FCCE51; Mon, 02 Feb 2026 20:22:17 +0100 (CET) Date: Mon, 2 Feb 2026 20:22:17 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Srinath Reddy Sadipiralla Cc: yanliang lei , pgsql-bugs@lists.postgresql.org Subject: Re: Re: Re: BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem. Message-ID: <202602021909.w2fnfmrdqrno@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="gxckbfrmvdeni6e6" 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 --gxckbfrmvdeni6e6 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2026-Feb-01, Srinath Reddy Sadipiralla wrote: > as you have suggested i have looked whether it effects the other behaviour > ,during table creation with not null constraints i observed that flow > doesn't > touch the AdjustNotNullInheritance where we added the error message, > When running CREATE TABLE, the standard NOT NULL merging logic is > handled by DefineRelation -> AddRelationNotNullConstraints. This function > explicitly handles the "Constraint Selection" logic (prioritizing the > Child's constraint if present, otherwise defaulting to the 1st > parent's constraint), please correct me if I totally understood your > concerns wrong here. Okay, it should be all good then. I noticed that some of the changes in the patch were unnecessary; I had added them transiently to cover the inheritance case while investigating, but since the real fix only affects directly specified constraints and doesn't touch inherited ones, we can remove them. In particular this reverts the unpleasant change that was going to occur for inherited constraints, which was quite bulky in the regression tests. I also reworded the message to be closer to our guidelines and to other nearby messages, and expanded the code comment that described why we're doing this check. Here's the patch in v3, which I intend to push tomorrow morning to both 18 and master. (It backpatches cleanly). For 18 it will mean an ABI break due to the change to AdjustNotNullInheritance()'s signature, requiring a touch to .abi-compliance-history as well, but that comes later. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ --gxckbfrmvdeni6e6 Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v3-0001-Reject-ADD-CONSTRAINT-NOT-NULL-if-name-mismatches.patch" Content-Transfer-Encoding: 8bit