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

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: btree gist indices, null and open-ended tsranges
Дата
Msg-id CA+bJJbz0vdsehAGpSanyvurVazRgGfpJuw2ez7hxQxuhPZGmzw@mail.gmail.com
обсуждение исходный текст
Ответ на btree gist indices, null and open-ended tsranges  (Chris Withers <chris@simplistix.co.uk>)
Ответы Re: [GENERAL] btree gist indices, null and open-ended tsranges
Список pgsql-general
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.


В списке pgsql-general по дате отправления:

Предыдущее
От: Francisco Olarte
Дата:
Сообщение: Re: Overwrite pg_catalog?
Следующее
От: rob stone
Дата:
Сообщение: Re: About the MONEY type