Re: BUG #15085: Domain "not null" constraint doesn't detect a null returned from a resultset

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Einspanjer <deinspanjer(at)gmail(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15085: Domain "not null" constraint doesn't detect a null returned from a resultset
Date: 2018-02-27 15:12:36
Message-ID: 4593.1519744356@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Daniel Einspanjer <deinspanjer(at)gmail(dot)com> 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Aiello 2018-02-27 16:54:53 RE: BUG #15091: to_number() returns incorrect value
Previous Message Daniel Einspanjer 2018-02-27 14:40:11 Re: BUG #15085: Domain "not null" constraint doesn't detect a null returned from a resultset