Re: replace() using NULL

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: replace() using NULL
Дата
Msg-id Yla1RQYrF9Qn3GR3@jrouhaud
обсуждение исходный текст
Ответ на replace() using NULL  (Susanne Holzgraefe <miracee@web.de>)
Ответы Re: replace() using NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
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