Re: concat fails 'sometimes' on empty colums in select

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Stefan de Konink <skinkie(at)xs4all(dot)nl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: concat fails 'sometimes' on empty colums in select
Date: 2004-12-11 19:54:35
Message-ID: 20041211195435.GE2668@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Dec 11, 2004 at 03:33:07 +0100,
Stefan de Konink <skinkie(at)xs4all(dot)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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Fuhr 2004-12-11 20:04:43 Re: concat fails 'sometimes' on empty colums in select
Previous Message Tom Lane 2004-12-11 18:42:53 Re: 8.0.0rc1 core dump with PREPARE in a function