Re: concat fails 'sometimes' on empty colums in select - Mailing list pgsql-bugs

From Bruno Wolff III
Subject Re: concat fails 'sometimes' on empty colums in select
Date
Msg-id 20041211195435.GE2668@wolff.to
Whole thread Raw
In response to concat fails 'sometimes' on empty colums in select  (Stefan de Konink <skinkie@xs4all.nl>)
Responses Re: concat fails 'sometimes' on empty colums in select  (Michael Fuhr <mike@fuhr.org>)
List pgsql-bugs
On Sat, Dec 11, 2004 at 03:33:07 +0100,
  Stefan de Konink <skinkie@xs4all.nl> wrote:
> Hi,
>
> I have a table with some empty colums, if I try to concat my colums to
> eachother something strange happens. Rather empty column B produces
> virtually no output using the || in the select query. But the half filed
> colum A does give the desired output.

Empty strings and NULL values aren't the same thing. You probably either
want to store empty strings or use coalesce to change NULL to an empty
string before using concatenation, as a NULL concatenated with anything
results in NULL.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: is it bug
Next
From: Michael Fuhr
Date:
Subject: Re: concat fails 'sometimes' on empty colums in select