Re: Wrong behaviour of array comparison when arrays contain nulls
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Wrong behaviour of array comparison when arrays contain nulls |
| Дата | |
| Msg-id | 3034594.1649252272@sss.pgh.pa.us обсуждение |
| Ответ на | Wrong behaviour of array comparison when arrays contain nulls (Lukas Eder <lukas.eder@gmail.com>) |
| Список | pgsql-bugs |
Lukas Eder <lukas.eder@gmail.com> writes:
> For the following query:
> SELECT array[1, NULL] = array[1, NULL]
> H2 returns NULL whereas PostgreSQL returns TRUE. In my opinion and
> intuition, as well as according to ISO/IEC 9075-2:2016(E) 8.2 <comparison
> predicate> GR 1) b) ii), H2 is right and PostgreSQL is wrong.
If we don't impose a total order on array values, then we cannot build
btree indexes on such columns. So yes, this is a deviation from the
SQL standard, and no we are not going to change it.
As for documentation, section 9.19 says
The comparison operators compare the array contents
element-by-element, using the default B-tree comparison function for
the element data type, and sort based on the first difference.
which implies this behavior but perhaps could be more explicit.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера