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 1u0M6q-00H6CU-Mr for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Apr 2025 15:04:00 +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 1u0M6p-008JhH-DB for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Apr 2025 15:03:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u0M6o-008Jfb-Kn for pgsql-hackers@lists.postgresql.org; Thu, 03 Apr 2025 15:03:59 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u0M6m-002kjX-1c for pgsql-hackers@postgresql.org; Thu, 03 Apr 2025 15:03:57 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id BA8BC114019E; Thu, 3 Apr 2025 11:03:54 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Thu, 03 Apr 2025 11:03:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1743692634; x=1743779034; bh=nV7aGioK1/OjKoNkaWLDzW4WpcRdbgbK MmG3KJxr9Cs=; b=MWopxOjKZvAWmoL6vp/BpQBdmtklz0qMXlr/nlTaZWdAUaag add3K7Usr1O9MiziE7WiZ5NTxMdcf4vd5v+odTgiuzQRkJiy8CWgChZAz5fH6cLG 9ygFzMiBeC6qb0H+yCaQOjcv1ILsulZd7ZaFSn3piXv0MbY5SE6k2LGCX0qxdr0L kfJRhJBB0fjKvbSjofq942l0Y69LHuAQ9qMvCLkNLk8JciWBWTyZ1+F3oorWgX4C inanGAeSihiGI5pHcz/OltrbY8ODacwmQ98AR+mY4yrFT2zltKFzKBTQ6eax/Vaq XR1rlJiO47kgOJpNatQxBFCtKbHE2euw81zKmw== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1743692634; x= 1743779034; bh=nV7aGioK1/OjKoNkaWLDzW4WpcRdbgbKMmG3KJxr9Cs=; b=b HjEr2OjNRBCdNBDnDDvSUrzQzd4q8/T/9/pWzd1ODHgjMsGToG6bWzVR3iry/OEN N47q20gMdQeCdpyf1GqwmgGskhwgOTWU3uQFHl4ibAZqNI3nJWXqGIC1lzjexSOU IkNUqAqQYFTiqTdqJuuBekzID8tX8IgTBZykZzwFbQbCe2TXOrDhimAouoG7rzar u/Ruyr06OhMnBTcwhZ1QUNOxEI4gpb0ADLS9wcud2K2ykvakUi+5V2G6ENL17pKS /q9TAWQmuY3402g9J5jmVwOQIFDi8Pc/ln+AKGOMzzGdGYdlsN2Vtm9ho1J7BFu3 KbeO0YOkIl6nW5jtXAGoQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddukeekkeejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddt vdejnecuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvih hsvghnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepgfejtdfhkeeftdeugfei leehteeljeeghfeuledthfeutedvffdukeefjefhgeehnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhht rdhorhhgpdhnsggprhgtphhtthhopeeipdhmohguvgepshhmthhpohhuthdprhgtphhtth hopegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhrtghpthhtohepjhhi rghnrdhunhhivhgvrhhsrghlihhthiesghhmrghilhdrtghomhdprhgtphhtthhopehroh gsvghrthhmhhgrrghssehgmhgrihhlrdgtohhmpdhrtghpthhtoheprhhushhhrggshhdr lhgrthhhihgrsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghshhhuthhoshhhrdgsrg hprghtrdhoshhssehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghk vghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Apr 2025 11:03:36 -0400 (EDT) Message-ID: Date: Thu, 3 Apr 2025 17:03:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints To: Alvaro Herrera Cc: jian he , Robert Haas , Rushabh Lathia , Ashutosh Bapat , PostgreSQL Hackers References: <202504030807.sj5yexcmrgpq@alvherre.pgsql> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <202504030807.sj5yexcmrgpq@alvherre.pgsql> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 03.04.25 10:07, Alvaro Herrera wrote: > The new flag is there for quick access by get_relation_info. We could > easily not have it otherwise, because clients don't need it, but its > lack would probably make planning measurably slower because it'd have to > do syscache access for every single not-null constraint to figure out if > it's valid or not. In the v6 patch, you are adding a attnullability field to the CompactAttribute in the tuple descriptor and use that in get_relation_info(). That seems like the right approach, because then you're doing all that preprocessing about which constraint is active in the relcache. So I don't see where the extra pg_attribute field attnotnullvalid is getting used.