Re: bug or feature, || -operator and NULLs

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: bug or feature, || -operator and NULLs
Дата
Msg-id 4536287A.8010503@dunslane.net
обсуждение исходный текст
Ответ на bug or feature, || -operator and NULLs  (Andreas Joseph Krogh <andreak@officenet.no>)
Ответы Re: bug or feature, || -operator and NULLs  (Andreas Joseph Krogh <andreak@officenet.no>)
Список pgsql-hackers
Andreas Joseph Krogh wrote:
> This has been been discussed before, but Oracle behaves differently, and IMHO 
> in a more correct way.
>
> The following query returns NULL in PG:
> SELECT NULL || 'fisk';
>
> But in Oracle, it returns 'fisk':
> SELECT NULL || 'fisk' FROM DUAL;
>
> The latter seems more logical...
>
>   

When in doubt, consult the standard ... Oracle's treatment of NULL is 
known to violate the standard, IIRC. Your measure of correctness seems 
to be "appears to me more logical", but ours is "complies with the 
standard".

In any case, why should null have a string value of '' any more than it 
should have a value of 'blurfl'?

Your analogy elsewhere with aggregate functions like sum() is not 
relevant, as these are documented to ignore null values.

cheers

andrew


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: bug or feature, || -operator and NULLs
Следующее
От: Csaba Nagy
Дата:
Сообщение: Re: bug or feature, || -operator and NULLs