Re: BUG #4865: replace function returns null

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #4865: replace function returns null
Дата
Msg-id 5148.1245419825@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #4865: replace function returns null  ("Jamolkhon Khakimov" <jkhakimov@gmail.com>)
Список pgsql-bugs
"Jamolkhon Khakimov" <jkhakimov@gmail.com> writes:
> replace( 'abcdefabcdef', 'XX', null)
> // returns null, while it should return 'abcdefabcdef'

No, it should return null.  Like most Postgres functions, replace is
strict, meaning it returns null if any input is null.  This is sensible
in the abstract because an unknown input means the result is unknown
too.  I suppose your argument is that the result here could be
determined without knowing what the third argument value is, but the
mechanism doesn't attempt to make such a fine distinction.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1
Следующее
От: Brendan Jurd
Дата:
Сообщение: Re: BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1