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 1tvgjR-007719-NE for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Mar 2025 18:04:33 +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 1tvgjQ-00CtkR-3m for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Mar 2025 18:04:32 +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 1tvgjP-00CtkJ-Go for pgsql-hackers@lists.postgresql.org; Fri, 21 Mar 2025 18:04:31 +0000 Received: from fout-a1-smtp.messagingengine.com ([103.168.172.144]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tvgjM-000MXS-0h for pgsql-hackers@postgresql.org; Fri, 21 Mar 2025 18:04:31 +0000 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id AC1971382D55; Fri, 21 Mar 2025 14:04:25 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Fri, 21 Mar 2025 14:04:25 -0400 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=1742580265; x=1742666665; bh=4 RqI+UmJFptL9xf3Euc3xwWMu56dR6EEeh5pKPXBAqE=; b=UFCtSidG8XRlXU8es Js/F2zfyiooAFqC71mQhfUalXerIhIs9QBROT5dQGKXC5VnfDlwozjB++hmVLEPX yKl18HuzxbmNIjCi8t/OrV1SuipoEdH2K2sNr5WX4nEu72SCKzJO8VyIyYR7pSqH qUswG1AzkPY2oJ3qu8j9WYyskUKdFFW5XFEUZrnwJAp2r/KbCKDNVdxEej/i1OsT zQq7AulaoN7n0lzvO0kU/BwZbpnXb+D80+rd6xEx9YXhMfDsa20Ip1XWIan+Dobi kfiRvxodot8K5Bd0FOjtyheZZQEMiWgAyKeNUzdf6r5E42LDHzsdt6u0gZ2aMIip C7xyA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduhedujeeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddt jeenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlh hvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepueeigfffueektdfgteeu uefgtedvueehgfehleefheeljeelfeffjedttdekvdejnecuffhomhgrihhnpehpohhsth hgrhdrvghspdgvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnoh dqihhprdhorhhgpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgt phhtthhopegrshhhuhhtohhshhdrsggrphgrthdrohhsshesghhmrghilhdrtghomhdprh gtphhtthhopehrohgsvghrthhmhhgrrghssehgmhgrihhlrdgtohhmpdhrtghpthhtohep rhhushhhrggshhdrlhgrthhhihgrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgsh hqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 Mar 2025 14:04:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1742580250; bh=qv33suC9V9rMBu2HQzQJ0JKCF3PdiQJ0USqU+YO6l9M=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=pJPq8JyuaTHr5OBeYqVP0QrrMC43cJaDQlsAG6V3NzptSiqyoq2zVOSJjwchoCUei AHwswpStYVrYcC/EYkHxxFgn2dMqFJUHOc0PU03mrhHM8zhR/5JjIFfwjfc4b9CAuv aH3Ynv1GBxrcvgCGqGvox1fuKBWo/9RnLZbKEByM97iIgWn9Mol1HluzlM+RV1dCej yTxaMywkfK71Iq2N37sx0T2se9jqEtL5kaYq/s8gMAn/fv1YcmX7wiNK+cqX4uPBnG NPZT4OaHJH+Sg+7vLIS02JgAsX21innEG4g4S0BVHkoOjOdKT89+bsRyA4xK8mG5co LwoNCyqPDMrGg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id A4C5C8F; Fri, 21 Mar 2025 19:04:10 +0100 (CET) Date: Fri, 21 Mar 2025 19:04:10 +0100 From: Alvaro Herrera To: Robert Haas Cc: Rushabh Lathia , Ashutosh Bapat , PostgreSQL Hackers Subject: Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints Message-ID: <202503211804.xlgvkeq4dhc4@alvherre.pgsql> 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 2025-Mar-21, Robert Haas wrote: > I don't agree with this conclusion. Uhm. > The 8.3 casting changes were problematic because any piece of SQL > you'd ever written could have problems. Okay, this much I agree with. > This change will only break queries that look at the attnotnull > column. While there may be quite a few of those, it can't possibly be > of the same order. I think it's routine that changing the name or type > of system catalog columns breaks things for a few people (e.g. > procpid->pid, or relistemp->relpersistence) and we sometimes get > complaints about that, but at least you can grep for it and it's > mostly going to affect admin tools rather than all the queries > everywhere. In several of the cases that I checked, the application just tests the returned value for boolean truth. If we change the column from boolean to char, they would stop working properly because both the 't' and the 'f' char values would test as true. But suppose we were to rename the column; that would cause developers to have to examine the code to determine how to react. That might even be good, because we're end up in a situation were no application uses outdated assumptions about nullness in a column. However, consider the rationale given in https://postgr.es/m/2542644.1733418030@sss.pgh.pa.us that removing attndims would break PHP -- after that discussion, we decided against removing the column, even though it's completely useless, because we don't want to break PHP. You know, removing attnotnull would break PHP in exactly the same way, or maybe in some worse way. I don't see how can we reach a different conclusion for this change that for that one. > That's not to say that adding a second bool column instead of changing > the existing column's data type is necessarily the wrong way to go. > But I think you're overestimating the blast radius by quite a lot. I am just going by some truth established by previous discussion. If we agree to remove attnotnull or to change the way it works, then we can also remove attndims. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/