Re: NULL values and string

Поиск
Список
Период
Сортировка
От Berend Tober
Тема Re: NULL values and string
Дата
Msg-id 43E20FE9.2060401@seaworthysys.com
обсуждение исходный текст
Ответ на Re: NULL values and string  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Richard Huxton wrote:

> Sergey Karin wrote:
>
>> Are there any abilities to represent NULL values as string?
>
>
> Null isn't a real value. Try not to think of it as a value.
>
That being said, and with due credit elsewhere (http://www.varlena.com/varlena/GeneralBits/84.php), what I do is


CREATE OR REPLACE FUNCTION public.textcat_null(text, text)
  RETURNS text AS
'SELECT textcat(COALESCE($1, ''''), COALESCE($2, ''''));'
LANGUAGE sql' VOLATILE;



CREATE OPERATOR public.||+(
  PROCEDURE = "public.textcat_null",
  LEFTARG = text,
  RIGHTARG = text);

This goes against proper form, considering what NULL is designed for, but it sure is convenient.


Regards,
Berend Tober



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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: plpgsql parameters
Следующее
От: "Justin Pasher"
Дата:
Сообщение: Re: Best way to handle table trigger on update