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 1qdZee-003xtd-I0 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Sep 2023 17:15:56 +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 1qdZed-003bFF-G8 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Sep 2023 17:15:55 +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 1qdZed-003bF1-6L for pgsql-hackers@lists.postgresql.org; Tue, 05 Sep 2023 17:15:54 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qdZeY-003EdN-My for pgsql-hackers@lists.postgresql.org; Tue, 05 Sep 2023 17:15:54 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id C05A5320099B; Tue, 5 Sep 2023 13:15:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 05 Sep 2023 13:15:48 -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:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1693934147; x= 1694020547; bh=LnKOnmXTGWjfMHoziWKvEzmQxtK6Itl51CZRCpmrx8Q=; b=l Xn2aQfsEWnoZD/htkDd1dS6BmdGmOjdUZBAmb/IUwO4m9uinkJoNjkGYok6jKO6p 9RHtbTUQo3UHDW8kGZACQAgZ8QL+3CXt1RbQ954AHdWAjZYdwe4rMFUrCMVQ+dBw RsuTH503DS2D4az8YxWxptF7P30inXFWJl7/1IFxuMXEg20RU0ptlI+GBC/HgHJq URfmJ1QMCbxhgmez98MpedwWN/C5FcZr82blRdFncS3ide/ElZ8+ziIulrUJULHe QXxhzRwvG+jSRtrOgNmynHTDcgMBBj2sK4DfZosFWBtyCWdz/IC9RkjwhPLZ0eIp DxTW8DDOgWZ9eeEvHjd1w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehuddgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Sep 2023 13:15:46 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id F22D1426; Tue, 5 Sep 2023 19:15:43 +0200 (CEST) Date: Tue, 5 Sep 2023 19:15:43 +0200 From: Alvaro Herrera To: Pg Hackers , Tom Lane , Peter Eisentraut Cc: Peter Eisentraut Subject: Re: information_schema and not-null constraints Message-ID: <202309051715.7ghhtqh76hyw@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202309051624.hrzj5uy3dmg3@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Sep-05, Alvaro Herrera wrote: > 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. Looking now at what to do for CHECK_CONSTRAINTS with domain constraints, I admit I'm completely confused about what this view is supposed to show. Currently, we show the constraint name and a definition like "CHECK (column IS NOT NULL)". But since the table name is not given, it is not possible to know to what table the column name refers to. For domains, we could show "CHECK (VALUE IS NOT NULL)" but again with no indication of what domain it applies to, or anything at all that would make this useful in any way whatsoever. So this whole thing seems pretty futile and I'm disinclined to waste much time on it. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/