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

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: bug or feature, || -operator and NULLs
Дата
Msg-id 20061018131132.GP31297@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: bug or feature, || -operator and NULLs  (Andreas Joseph Krogh <andreak@officenet.no>)
Список pgsql-hackers
Andreas Joseph Krogh wrote:

> Why do these discussions always end in academic arguments over whats more 
> logical then not? From a *user's* point of view I really would like it to 
> treat the NULL operand of || as '', and obviously many other (at least 
> Oracle) users tend to agree with me on that.

So coalesce the column to the empty string if that's what you want:

select coalesce(NULL, '') || 'fisk'

will get you 'fisk'.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


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

Предыдущее
От: Lukas Kahwe Smith
Дата:
Сообщение: Re: bug or feature, || -operator and NULLs
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: bug or feature, || -operator and NULLs