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 1u1I43-00HPZg-Kx for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Apr 2025 04:56:59 +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 1u1I40-0083X2-PN for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Apr 2025 04:56:57 +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 1u1I40-0083Wr-4u for pgsql-hackers@lists.postgresql.org; Sun, 06 Apr 2025 04:56:56 +0000 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u1I3x-003f57-2Y for pgsql-hackers@postgresql.org; Sun, 06 Apr 2025 04:56:56 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id 27A4D11400DA; Sun, 6 Apr 2025 00:56:51 -0400 (EDT) Received: from phl-imap-07 ([10.202.2.97]) by phl-compute-11.internal (MEProxy); Sun, 06 Apr 2025 00:56:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1743915411; x=1744001811; bh=FASyvTAFv3NNzOmmUFGO0OgD/8C4gt9GmOY 0BiSKAOo=; b=eNkW0LKoNPL8XPAmsqkowgN00+vJm19vFTxeNsUhzn43ePUqMk2 fskwCXfsnoGLJ6KvDxfXOkg0EnXQz7pX6a2pJ+iFhvk1bFxdoMz4iiegi3/5Jy4g 7aSLw8j7K34OZDiO7WF9mzV9aV1absGtpgRjr+Ff3tKD66aPoQX8NtUN2xLW2yNg edJYskkkfwPzrn61UuSnqNnmmM7mJ4/KxXaVJCuP0EFry0aBOI8yoiiwexbuUb2n 3KuyzOsafTfyxpe+mfXaSHYUDssbchGcqx99w8VrEWmlvos+QKW/YYTbPgvkq/+y 5DqJ9tQTJIjjXgmdCyMVbpLnACmRUjbguKA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduleeifeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvfevkfgjfhfutgesrgdtreerredt jeenucfhrhhomheplmhlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlh hvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepieekveevgedugefhfefg ieeuudejvdeggfdthfduuedvuefhtddtfeetkeeuteelnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhho qdhiphdrohhrghdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtg hpthhtohepjhhirghnrdhunhhivhgvrhhsrghlihhthiesghhmrghilhdrtghomhdprhgt phhtthhopehruhhshhgrsghhrdhlrghthhhirgesghhmrghilhdrtghomhdprhgtphhtth hopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id C4DEEBA0070; Sun, 6 Apr 2025 00:56:50 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: T5a90be2b8ffc5a15 Date: Sun, 06 Apr 2025 06:56:30 +0200 From: =?UTF-8?Q?=C3=81lvaro_Herrera?= To: "jian he" , "Rushabh Lathia" Cc: PostgreSQL-development Message-Id: <7b188cf1-c618-42cc-bd18-27dfcc6e8ea4@app.fastmail.com> In-Reply-To: References: <202504030807.sj5yexcmrgpq@alvherre.pgsql> Subject: Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints Content-Type: multipart/alternative; boundary=ef28c9e77625455983bdd50c954f7338 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ef28c9e77625455983bdd50c954f7338 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi I've been giving this some final polish which have me time to think it through, and I think Peter is right. We should not be adding the new column, but instead RelationBuildTupleDesc should use its existing scan of pg_constraint to determine validity status of constraints. We may need in addition a further value for attnullability that means unknown, "a constraint exists but we don't know yet if it's valid or invalid" for the times when we scanned pg_attribute but not yet pg_constraint. I think it's not too large a patch on top of that we have. I'm going on a little excursion now but should be back to work on this in a couple of hours. --ef28c9e77625455983bdd50c954f7338 Content-Type: text/html Content-Transfer-Encoding: 7bit
Hi

I've been giving this some final polish which have me time to think it through, and I think Peter is right. We should not be adding the new column, but instead RelationBuildTupleDesc should use its existing scan of pg_constraint to determine validity status of constraints. We may need in addition a further value for attnullability that means unknown, "a constraint exists but we don't know yet if it's valid or invalid" for the times when we scanned pg_attribute but not yet pg_constraint. I think it's not too large a patch on top of that we have.

I'm going on a little excursion now but should be back to work on this in a couple of hours.


--ef28c9e77625455983bdd50c954f7338--