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.94.2) (envelope-from ) id 1uuc27-00DoSB-4d for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Sep 2025 19:23:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uuc26-009yPN-68 for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Sep 2025 19:23:38 +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.94.2) (envelope-from ) id 1uuc25-009yNE-Rp for pgsql-hackers@lists.postgresql.org; Fri, 05 Sep 2025 19:23:38 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uuc22-000lK5-1z for pgsql-hackers@postgresql.org; Fri, 05 Sep 2025 19:23:37 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 1B1A01D002E0; Fri, 5 Sep 2025 15:23:33 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Fri, 05 Sep 2025 15:23:33 -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=fm2; t=1757100212; x= 1757186612; bh=kCsQzAW0UK71BY8cFot0SQnm+E/UnH4uqZk7kM4Rk2U=; b=F PRIONjV7kIEAQRJUURsZbRVwi9upNt6gTqSLkC/LdegMkxmtfdwRxleHYQSHIcrV emnNHPaOqq0FPCiNSeNicoVoNGcW73SlrU00C/OHAdfLXR8XEVjQahFlO5FuDl8E 65UckpBTyOFPvIq48wzfeeLFKjtEI2Wd5UOtPPVPmu949obXJY52Snon0uusq5k7 wWQVzJ9BqjYXYLppjsEoRwD/tIUTwdePR77vYWDs+lDOgxHbi5MIfc59HUMHYFF9 Jg6mi3IdE8nm6a2qBa2X9l/nvUVj8fvVbRFlhipUgTlkZuN9AO9k43BjQ8iFLwEe D6TZq+RyIi2KrMnROcuCQ== 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=fm1; t=1757100212; x=1757186612; bh=k CsQzAW0UK71BY8cFot0SQnm+E/UnH4uqZk7kM4Rk2U=; b=htyJhRek0wYLNSMsH Fdhtb+Tryn17xQCRaNkWktrltcNvxTKIrG0o0kYpjdnXOS2hss7OslOyrnUMKXKU jlL+ph6+EpobQvx4frXqB1LffGN4I5MD5rBFjkP6tDdQhptjjbRlaETrekAJpaOZ v+gDoCoMUNsDbd7RZWjPGOcb0IPQx02db3pWb+Q6FdhDynjBifI6XcgD03p9b3a/ qsdbqyCoBWFSp6hnlDkzbOuC5zpxIstLDiyuzuUbDC0kt0ByT52C9xFCUIo4Siss 5Xi0TOtwTSHQWglfZ5jbPr8mAHCAKtoSpKNxF+zq3kYzkI4bLQGo9QRgVYask+CJ Fwg1Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdeljeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttd ejnecuhfhrohhmpemllhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgeskhhu rhhilhgvmhhurdguvgeqnecuggftrfgrthhtvghrnhepteeuvdehffekvefgueehveetve ekgfegtddtueefueehuddutdfhfeffhfejfeffnecuffhomhgrihhnpegvnhhtvghrphhr ihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgdpnhgspghrtghpthht ohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjhhirghnrdhunhhivhgvrh hsrghlihhthiesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgv rhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 Sep 2025 15:23:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1757100210; bh=undJN3sSd4ZvK5iQizmUtwj5Oby6v5ZJIHTOaEDbi0M=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Ff/E2zew8ESwQsNISGs3bDHvnVEDn4trQTgYYfYvsVsW+hRqiPA/fRlKrGiUFpYSx jUCp3Yz18CZSlaZGeVJwpBNtLSQJ+y8UhkBClajf+HaOCBdFc5Ettv7IO0Obdcq74Z 8Ub6F167voiA3UBhHYuiHbDMyVmanahOWWin8WJ1/X7+OKVe3GwSrNdwAwuAgANGx3 qpBIX/SbMbIakPDc2xQHkTnFC4o4TIYyfT2eVYmqYBGRYO0yylZ+lotw1LXO4GuQ7+ I4Ez5wiY1M503qlTxTMCVf2Iyb65+3KFkl9HXXcqAOhlHCuBmFGMEXKA5vsS/v+qqC SBvIynGf17hAQ== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 54F438D; Fri, 5 Sep 2025 21:23:30 +0200 (CEST) Date: Fri, 5 Sep 2025 21:23:30 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: jian he Cc: PostgreSQL-development Subject: Re: NOT NULL NOT ENFORCED Message-ID: <202509051923.n4xc5vthqyhu@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202509041200.iivbiv66fp62@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Sep-04, Álvaro Herrera wrote: > On 2025-Sep-04, jian he wrote: > > + else if (notenforced) > > + { > > + /* > > + * We can't use ATExecSetNotNull here because it adds an enforced > > + * not-null constraint, but here we only want a non-enforced one. > > + */ > > Umm, wouldn't it make more sense to modify ATExecSetNotNull() so that it > does what we want? This seems hackish. BTW while you're at that, it might make sense to allow commands like ALTER TABLE foo ALTER col1 SET NOT NULL NOT VALID ALTER TABLE foo ALTER col1 SET NOT NULL NOT ENFORCED -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "La verdad no siempre es bonita, pero el hambre de ella sí"