Hi Chris:
On Thu, Dec 1, 2016 at 12:56 PM, Chris Withers <chris@simplistix.co.uk> wrote:
> So, first observation: if I make room nullable, the exclude constraint does
> not apply for rows that have a room of null. I guess that's to be expected,
> right?
I would expect it, given:
n=> select null=null, null<>null, not (null=null);
?column? | ?column? | ?column?
----------+----------+----------
| |
(1 row)
Those are nulls, BTW:
n=> select (null=null) is null, (null<>null) is null, (not (null=null)) is null;
?column? | ?column? | ?column?
----------+----------+----------
t | t | t
(1 row)
I.e., the same happens with a nullable unique column, you can have one
of each not null values and as many nulls as you want.
SQL null is a strange beast.
Francisco Olarte.