Re: coalesce for null AND empty strings

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: coalesce for null AND empty strings
Дата
Msg-id 460CCD49.7070201@magproductions.nl
обсуждение исходный текст
Ответ на coalesce for null AND empty strings  (Ferdinand Gassauer <gassauer@kde.org>)
Список pgsql-general
Ferdinand Gassauer wrote:
> Hi!
>
> it would be great to have a coalesce2 function which treats empty strings as
> null values.

I think

 COALESCE(NULLIF(value1, ''), value2)

does what you want. You could wrap that in a new function coalesce2 if
you like.

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
   7500 AK Enschede

// Integrate Your World //

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: coalesce for null AND empty strings
Следующее
От: Csaba Kalman
Дата:
Сообщение: PANIC: unexpected hash relation size