Skip site navigation (1) Skip section navigation (2)

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

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Stefan de Konink <skinkie(at)xs4all(dot)nl>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: concat fails 'sometimes' on empty colums in select
Date: 2004-12-11 20:04:43
Message-ID: 20041211200443.GA42436@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-bugs
On Sat, Dec 11, 2004 at 01:54:35PM -0600, Bruno Wolff III wrote:
> 
> 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.

To simplify this operation you could create an operator that does
the coalesce for you.  This has come up recently; search the list
archives for examples.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

pgsql-bugs by date

Next:From: Michael FuhrDate: 2004-12-12 01:55:57
Subject: Re: create/drop table bug
Previous:From: Bruno Wolff IIIDate: 2004-12-11 19:54:35
Subject: Re: concat fails 'sometimes' on empty colums in select

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group