Re: select array_remove(ARRAY[NULL,NULL,NULL],NULL); returns {} instead of {NULL,NULL,NULL}
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: select array_remove(ARRAY[NULL,NULL,NULL],NULL); returns {} instead of {NULL,NULL,NULL} |
| Дата | |
| Msg-id | 25549.1470698293@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: select array_remove(ARRAY[NULL,NULL,NULL],NULL); returns {} instead of {NULL,NULL,NULL} ("David G. Johnston" <david.g.johnston@gmail.com>) |
| Список | pgsql-general |
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Mon, Aug 8, 2016 at 5:51 PM, Alban Hertroys <haramrae@gmail.com> wrote:
>> How does it now which unknown value to remove from that array of unknown
>> values? Shouldn't the result be:
>> {NULL,NULL,NULL}?
> Is this a philosophical or technical question?
> For the former I don't see why one would choose to define this function in
> any other way. If you accept that the searching value can be NULL then it
> follows that you must compare two NULLs as equal.
Strictly speaking, array_remove (and I think array_replace as well)
implements "IS NOT DISTINCT FROM" semantics rather than "=" semantics.
I dunno that we want to make the documentation use that wording though,
it'd probably confuse more people than it helped.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера