Re: replace() using NULL

Поиск
Список
Период
Сортировка
Искать
От
Julien Rouhaud
Тема
Re: replace() using NULL
Дата
Msg-id
Yla1RQYrF9Qn3GR3@jrouhaud
Ответ на
replace() using NULL (Susanne Holzgraefe)
Список
Дерево обсуждения
replace() using NULL Susanne Holzgraefe <miracee@web.de>
Re: replace() using NULL Julien Rouhaud <rjuju123@gmail.com>
Re: replace() using NULL Tom Lane <tgl@sss.pgh.pa.us>
Hi,

On Wed, Apr 13, 2022 at 10:38:28AM +0200, Susanne Holzgraefe wrote:
>
> tested by using postgresql 13.5:
>
> SELECT REPLACE('xyz‘, ’y’, ’a’); => xaz => expected
> SELECT REPLACE('xyz', 'a‘, 'b‘); => xyz => expected
>
> SELECT REPLACE('xyz‘, 'a‘, NULL); => NULL
>
> Also tested by using MariaDB. Same behavior like in PG.
> Tested with Oracle, result is ‚xyz‘.
>
> That is what I would expect because xyz includes no a.
>
> I neither can find any documentation about this nor a bug report.

The function is declared as STRICT, which means that it won't be called at all
and just returns NULL if any of its parameters is NULL.

Maybe oracle supports such calls as it supports NULL bytes in strings (I
think), but postgres doesn't.


В списке pgsql-bugs по дате отправления
От: Susanne Holzgraefe
Дата:
Сообщение: replace() using NULL
От: Tom Lane
Дата:
Сообщение: Re: replace() using NULL
FAQ