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 1qdqJM-004uko-EI for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Sep 2023 11:03:05 +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 1qdqJL-009SpK-0S for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Sep 2023 11:03:02 +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 1qdqJJ-009Sok-Af for pgsql-hackers@lists.postgresql.org; Wed, 06 Sep 2023 11:03:02 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qdqJD-003OwX-Tq for pgsql-hackers@lists.postgresql.org; Wed, 06 Sep 2023 11:03:00 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E61FB5C010E; Wed, 6 Sep 2023 07:02:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 06 Sep 2023 07:02:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=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:sender:subject:subject:to:to; s=fm3; t= 1693998173; x=1694084573; bh=4kxR4U56L5EYSWa1e6aQxsgpiD8+tSOufdq cS/FjFxQ=; b=c5MYEFGbIsey1cOo3lkP4ctdZ9H/N7FumANySQLh92hfEPs2sHl WITpskSqInl0333J/1cHji/b5FNugjAsA8KtIspFHdM+R1Ld1wb2Zq03vtYM3P9G zKyAFNORSmw+GxooaUBAUhOxesmjSA1PoT7VbOfSR91DHqcjcAh2uQjfF1qzQT5E QN9FjjDKrl9o05pdeJrfUHnPQYcQO70Hlu0aaF+pJbESN7Vr4ZLUl8wFvIx0m/WY DCgD+f1SwZk8wG1WuDC+7ur/0ZCV+GKI3bsE4qRo98q3yj12uEvFddJPO8A/WBHu qJukLN7M63rxMFSdPA2UTrJXv3wNmR7hgyw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1693998173; x= 1694084573; bh=4kxR4U56L5EYSWa1e6aQxsgpiD8+tSOufdqcS/FjFxQ=; b=g uDIeBKRZ7gdKOiNbWQAbVvioL0syAHrZ90prX0nbAuKZ8quI9UhHBNpww1LuM1En ueNCEaSJEAhjcfDJZX8gl2fhourw0HuE0NvvtYCMqCBdCp2aX4W/gvpttIHAyiCi qkALCGZcCsQ73iwrC+ou5sSbvx/i9F+rtAu4ojhrp045iHdXV1zqUgMCGylmonId MK2NLK5io2cTtHrt09tbV6Vlj1wioafbCG7yPX6AytjZyYTKBXR38hr6zDigIr/e PLBkXtlaiEHzvk5ZEJhtl5SGJwe3Z/8fGXiaWj6ESJ3QuewEfVWiscqhe4UMJEWp I/1o+Ug5a8zq/ksP6VjfA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehfedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqe enucggtffrrghtthgvrhhnpedugfduudehhfejieeuudfhieffveeghffggffhgfffgfdu vefhleejieejhfduleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Sep 2023 07:02:52 -0400 (EDT) Message-ID: Date: Wed, 6 Sep 2023 13:02:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: information_schema and not-null constraints Content-Language: en-US To: Alvaro Herrera , Pg Hackers References: <202309051624.hrzj5uy3dmg3@alvherre.pgsql> From: Peter Eisentraut In-Reply-To: <202309051624.hrzj5uy3dmg3@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 05.09.23 18:24, Alvaro Herrera wrote: > On 2023-Sep-05, Peter Eisentraut wrote: > >> The following information schema views are affected by the not-null >> constraint catalog entries: >> >> 1. CHECK_CONSTRAINTS >> 2. CONSTRAINT_COLUMN_USAGE >> 3. DOMAIN_CONSTRAINTS >> 4. TABLE_CONSTRAINTS >> >> Note that 1 and 3 also contain domain constraints. > > After looking at what happens for domain constraints in older versions > (I tested 15, but I suppose this applies everywhere), I notice that we > don't seem to handle them anywhere that I can see. My quick exercise is > just > > create domain nnint as int not null; > create table foo (a nnint); > > and then verify that this constraint shows nowhere -- it's not in > DOMAIN_CONSTRAINTS for starters, which is I think the most obvious place. > And nothing is shown in CHECK_CONSTRAINTS nor TABLE_CONSTRAINTS either. > > This did ever work in the past? I tested with 9.3 and didn't see > anything there either. No, this was never implemented. (As I wrote in my other message on the other thread, arguably a bit buggy.) We could fix this separately, unless we are going to implement catalogued domain not-null constraints soon.