Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eqgvq-0006od-2z for pgsql-bugs@arkaria.postgresql.org; Tue, 27 Feb 2018 15:12:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eqgvo-0003MA-KM for pgsql-bugs@arkaria.postgresql.org; Tue, 27 Feb 2018 15:12:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eqgvo-0003M1-Az for pgsql-bugs@lists.postgresql.org; Tue, 27 Feb 2018 15:12:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eqgvm-00069G-10 for pgsql-bugs@lists.postgresql.org; Tue, 27 Feb 2018 15:12:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1RFCaxY004594; Tue, 27 Feb 2018 10:12:36 -0500 From: Tom Lane To: Daniel Einspanjer cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #15085: Domain "not null" constraint doesn't detect a null returned from a resultset In-reply-to: References: <151952089752.1463.4091997216675283064@wrigleys.postgresql.org> <13059.1519529706@sss.pgh.pa.us> Comments: In-reply-to Daniel Einspanjer message dated "Tue, 27 Feb 2018 14:40:11 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4592.1519744356.1@sss.pgh.pa.us> Date: Tue, 27 Feb 2018 10:12:36 -0500 Message-ID: <4593.1519744356@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Daniel Einspanjer writes: > Tom, please forgive me if this is a non-starter for a suggestion, but what > about forcing a not null constraint on a column that is declared to be of > the type of a domain that has a not null constraint? I don't particularly want to go there. What happens when you add or drop the not null constraint on an existing domain type? In any case, this would amount to positive reinforcement for people who use domain not null constraints, which IMO is bad practice to start with. Not everything in the SQL standard is a good idea. regards, tom lane