Re: - Mailing list pgsql-general

From Alexander Litvinov
Subject Re:
Date
Msg-id 200310011727.21502.lan@ac-sw.com
Whole thread Raw
In response to Re:  ("Daniel Schuchardt" <daniel_schuchardt@web.de>)
List 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;

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Stored procedures with variable number of args ?
Next
From: "Daniel Schuchardt"
Date:
Subject: Re: