Re: BUG #18451: NULL fails to coerce to string when performing string comparison

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #18451: NULL fails to coerce to string when performing string comparison
Дата
Msg-id CAApHDvq3CcqqymBK4ov2hX_MhSGkDLtL9LeYWhj_Gb7q7-xmVQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #18451: NULL fails to coerce to string when performing string comparison  (Darryl Dixon <darryl.dixon@gmail.com>)
Список pgsql-bugs
On Wed, 1 May 2024 at 10:01, Darryl Dixon <darryl.dixon@gmail.com> wrote:
>
> The bug is that:
> 1) The concatenation is not producing NULL, but rather Text, and yet the comparison fails regardless, and

I think you're just wrongly assuming casting an unknown NULL to a type
is making it somehow non-NULL. That's just not the case. NULLs can
have a type. They're still NULL.

postgres=# select 'ab' || NULL::text is null;
 ?column?
----------
 t

David



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #18451: NULL fails to coerce to string when performing string comparison
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #18451: NULL fails to coerce to string when performing string comparison