Search Postgresql Archives

Re: NULL values and string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux