Re: is this a bug?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: is this a bug?
Дата
Msg-id 14173.1263772020@sss.pgh.pa.us
обсуждение исходный текст
Ответ на is this a bug?  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: is this a bug?  (Jeff Davis <pgsql@j-davis.com>)
Re: is this a bug?  ("David E. Wheeler" <david@kineticode.com>)
Список pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
>   create type y as (c char, n int);
>   select ('a', NULL)::y = ('a', NULL)::y; -- TRUE 
>   select ('a', NULL) = ('a', NULL); -- NULL

> I would expect those to evaluate to the same thing.

The latter gets simplified to ('a' = 'a') AND (NULL = NULL).
The former doesn't --- it goes through record_eq, which treats
two nulls as equal.

The reason record_eq does that is that we have to have a total ordering
in order for record types to be indexable or sortable.

The former might be closer to the spec's expectations but I'm not
totally sure about it.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: parallel regression test output
Следующее
От: Greg Smith
Дата:
Сообщение: Re: Clearing global statistics