Re: btree gist indices, null and open-ended tsranges

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: Chris Withers <chris(at)simplistix(dot)co(dot)uk>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: btree gist indices, null and open-ended tsranges
Date: 2016-12-01 12:12:18
Message-ID: CA+bJJbz0vdsehAGpSanyvurVazRgGfpJuw2ez7hxQxuhPZGmzw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Chris:

On Thu, Dec 1, 2016 at 12:56 PM, Chris Withers <chris(at)simplistix(dot)co(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message rob stone 2016-12-01 12:45:14 Re: About the MONEY type
Previous Message Francisco Olarte 2016-12-01 12:07:09 Re: Overwrite pg_catalog?