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 CAApHDvqRG-cd92D2YV8+C3wLAT0_1ut=X4yX0DetGQ+gGAhtRA@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #18451: NULL fails to coerce to string when performing string comparison  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #18451: NULL fails to coerce to string when performing string comparison
Список pgsql-bugs
On Wed, 1 May 2024 at 09:06, PG Bug reporting form
<noreply@postgresql.org> wrote:
> postdb=# select where 'ab'||NULL like '%a%';
> --
> (0 rows)
>
> postdb=# select where 'ab'||NULL::text like '%a%';
> --
> (0 rows)

You've not mentioned where you think the bug is, but if you think it's
in either of the above, PostgreSQL is following the SQL standard here.

The SQL2016 copy I have here says:

"6.31 <string value expression>

If at least one of S1 and S2 is the null value, then the result of the
<concatenation> is the null value."

There are a few RDBMSs that are lax on this rule, perhaps you're here
because PostgreSQL isn't doing what you're used to?

David



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

Предыдущее
От: Darryl Dixon
Дата:
Сообщение: 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