Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaaqU-0004an-7F for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Sep 2022 10:51:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oaaqS-0000xU-4P for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Sep 2022 10:51:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaaqR-0000xL-R1 for pgsql-hackers@lists.postgresql.org; Tue, 20 Sep 2022 10:51:15 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaaqP-00067W-Dw for pgsql-hackers@lists.postgresql.org; Tue, 20 Sep 2022 10:51:14 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 12AB73200945; Tue, 20 Sep 2022 06:51:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 20 Sep 2022 06:51:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=fm2; t=1663671071; x=1663757471; bh=+ Q9xALlSwONO77Gjpf16CiJNSQA457JtZDOQKoF2e1E=; b=CzUv0hLHhSPVciSjb lITDF+se6bhmzTBLxq942aV0bV2S2TuVuOOuIC8UlY6zMvxaX8+R59zgGu3jNXUr DZExLYMnoyPW/LhsWnY7IFomcaBukuBfPal6R51Z/PbXhhuKAT6HJau222msgk7/ owJ9QOa6SuiGqubmM+duo9bEf1ECSVmuSC95iZGIJ7Sp/dpZcr9TkK4zqrJoiajA UMKgmVEm0crzWHKsm6bcogYqXS2i+fYVFbXPdUD9No2JmaxfF5xcHmi1U3a6TlLt ajAreNLIMvCsr4JngF2EucTcQMGHCyVIstBStZ68u2p6rRxcleM1pRokN3InMCRA yj/UQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedvledgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepteejtdehuddutdethffhffekleefueetlefhffeigfei ieehgeeigfeiffejuedvnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh dprggtthhsohhfghhorhgurdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Sep 2022 06:51:11 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 9B1BD38F; Tue, 20 Sep 2022 12:51:09 +0200 (CEST) Date: Tue, 20 Sep 2022 12:51:09 +0200 From: Alvaro Herrera To: Robert Haas Cc: Pg Hackers Subject: Re: cataloguing NOT NULL constraints Message-ID: <20220920105109.kopdp7wmlkfi5ci5@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Sep-19, Robert Haas wrote: > On Wed, Aug 17, 2022 at 2:12 PM Alvaro Herrera wrote: > > 55489 16devel 1776237=# \d tab > > Tabla «public.tab» > > Columna │ Tipo │ Ordenamiento │ Nulable │ Por omisión > > ─────────┼─────────┼──────────────┼──────────┼───────────── > > a │ integer │ │ not null │ > > Restricciones CHECK: > > "tab_a_not_null" CHECK (a IS NOT NULL) > > In a table with many columns, most of which are NOT NULL, this is > going to produce a ton of clutter. I don't like that. > > I'm not sure what a good alternative would be, though. Perhaps that can be solved by displaying the constraint name in the table: 55489 16devel 1776237=# \d tab Tabla «public.tab» Columna │ Tipo │ Ordenamiento │ Nulable │ Por omisión ─────────┼─────────┼──────────────┼────────────────┼───────────── a │ integer │ │ tab_a_not_null │ (Perhaps we can change the column title also, not sure.) -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "The Gord often wonders why people threaten never to come back after they've been told never to return" (www.actsofgord.com)