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
Дата
Msg-id CAKFQuwZvPW+EH1cDCjti8EC_ke5-84Z6HBPjxfos4q4QUxuv-A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #18451: NULL fails to coerce to string when performing string comparison  (Darryl Dixon <darryl.dixon@gmail.com>)
Ответы Re: BUG #18451: NULL fails to coerce to string when performing string comparison
Список pgsql-bugs
On Tuesday, April 30, 2024, Darryl Dixon <darryl.dixon@gmail.com> wrote:
Hi,

There are a couple of notes regarding this:
1) There is an explicit CAST of NULL->text that silently fails (see original example)

It doesn’t fail.  Casting null still results in null.  (Null::integer)::text is valid, you end up with a null integer converted to a null of type text.

2) This behaviour, if expected, is not well documented/contradicted by existing documentation. See the note here:

Fair, we don’t explicitly document that ‘…’ || NULL yields NULL.  It’s more of “unless otherwise noted doing stuff with null results in unknown/null outcomes”.

David J.

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: BUG #18451: NULL fails to coerce to string when performing string comparison
Следующее
От: Darryl Dixon
Дата:
Сообщение: Re: BUG #18451: NULL fails to coerce to string when performing string comparison