Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 93FA0B5DBF0 for ; Sun, 7 Aug 2011 06:44:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 51767-09 for ; Sun, 7 Aug 2011 09:43:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by mail.postgresql.org (Postfix) with SMTP id 2AF8AB5DBCE for ; Sun, 7 Aug 2011 06:43:55 -0300 (ADT) Received: (qmail invoked by alias); 07 Aug 2011 09:43:54 -0000 Received: from a88-115-218-165.elisa-laajakaista.fi (EHLO [10.0.0.102]) [88.115.218.165] by mail.gmx.net (mp012) with SMTP; 07 Aug 2011 11:43:54 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX19YmJROgfVY2PIxqRKixtBxL933xSAk6OzwHAHLg5 iH9ZMUzLkED/05 Subject: Re: cataloguing NOT NULL constraints From: Peter Eisentraut To: Dean Rasheed Cc: Alvaro Herrera , Robert Haas , Pg Hackers In-Reply-To: References: <20110707213401.GA27098@alvh.no-ip.org> <1311291819-sup-6206@alvh.no-ip.org> <1311367030-sup-9426@alvh.no-ip.org> <1311985058-sup-952@alvh.no-ip.org> <1312342392-sup-7189@alvh.no-ip.org> <1312480674.24208.8.camel@vanquo.pezone.net> <1312624993.24721.16.camel@vanquo.pezone.net> Content-Type: text/plain; charset="UTF-8" Date: Sun, 07 Aug 2011 12:43:52 +0300 Message-ID: <1312710232.24721.19.camel@vanquo.pezone.net> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.682 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.783 X-Spam-Level: X-Archive-Number: 201108/326 X-Sequence-Number: 193081 On lör, 2011-08-06 at 12:58 +0100, Dean Rasheed wrote: > Right now \d gives: > > Table "public.foo" > Column | Type | Modifiers > --------+---------+----------- > a | integer | not null > b | integer | > c | integer | > Check constraints: > "foo_b_check" CHECK (b IS NOT NULL) > "foo_c_check" CHECK (NOT c IS NULL) > > With this approach, one change would be that you'd gain an extra "not > null" in the Modifiers column for "b". > > But how many CHECK constraints would show? I guess it would show 3, > although it could be changed to just show 1. But it certainly couldn't > continue to show 2, since nothing in the catalogs could distinguish > the constraints on "a" from those on "b". I'd say we would show all (what is currently known as) NOT NULL constraints under "Check constraints:".