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 1tVdXc-00ACjw-7j for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 21:24: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 1tVdXb-007HGj-E1 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 21:24:39 +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 1tVdXb-007HGa-4z for pgsql-hackers@lists.postgresql.org; Wed, 08 Jan 2025 21:24:38 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tVdXX-000bfy-1W for pgsql-hackers@lists.postgresql.org; Wed, 08 Jan 2025 21:24:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 508LOYFu1694912; Wed, 8 Jan 2025 16:24:34 -0500 From: Tom Lane To: Bruce Momjian cc: jbe-mlist@magnetkern.de, PostgreSQL-development Subject: Re: Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL) In-reply-to: References: <173591158454.714.7664064332419606037@wrigleys.postgresql.org> Comments: In-reply-to Bruce Momjian message dated "Wed, 08 Jan 2025 16:10:42 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1694910.1736371474.1@sss.pgh.pa.us> Date: Wed, 08 Jan 2025 16:24:34 -0500 Message-ID: <1694911.1736371474@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bruce Momjian writes: > I think this needs some serious research. We've discussed this topic before. The spec's definition of IS [NOT] NULL for composite values is bizarre to say the least. I think there's been an intentional choice to keep most NOT NULL checks "simple", that is we look at the overall value's isnull bit and don't probe any deeper than that. If the optimizations added in v17 changed existing behavior, I agree that's bad. We should probably fix it so that those are only applied when argisrow is false. regards, tom lane