Re: <no subject>

From: Alexander Litvinov <lan(at)ac-sw(dot)com>
To: "Daniel Schuchardt" <daniel_schuchardt(at)web(dot)de>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: <no subject>
Date: 2003-10-01 10:27:20
Message-ID: 200310011727.21502.lan@ac-sw.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> But CAST(NULL AS VARCHAR) should make it a varchar so i should be able
> to || the both values. So perhaps a bug in CAST.
>
> The only way here would be to make a CASE WHEN - i think thats not a
> good behavoir.

NULL is null even it have varchar type, it is not an empty string. Try to do
the following:

select field1 || case when field2 is null then '' else field2 end from
my_big_table;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Schuchardt 2003-10-01 10:32:21 Re: <no subject>
Previous Message Peter Eisentraut 2003-10-01 10:26:15 Re: Stored procedures with variable number of args ?