Re: [HACKERS] empty concatenate - Mailing list pgsql-hackers

From sszabo@bigpanda.com
Subject Re: [HACKERS] empty concatenate
Date
Msg-id 199912231658.LAA26868@blargh.bigpanda.org
Whole thread Raw
In response to Re: [HACKERS] empty concatenate  (Karel Zak - Zakkr <zakkr@zf.jcu.cz>)
Responses Re: [HACKERS] empty concatenate
Re: [HACKERS] empty concatenate
List pgsql-hackers
>
>Well, but why PgSQL ignore function result if any argument is NULL. IMHO is
>function's problem what return, and PgSQL must use this result. 
I believe this is a known issue that's being looked at right now.

However, in this case PostgreSQL seems to be correct. 
2) If <concatenation> is specified, then let S1 and S2 be the re-sult of the <character value expression> and
<characterfactor>,respectively.Case:a) If either S1 or S2 is the null value, then the result of the <concatenation> is
thenull value.
 

>How can user write / use function which response on NULL (as IFNULL())?
Well, for now, you probably want to use coalesce around any input that
might be null.  I believe coalesce returns the first non-null parameter,
so coalesce(<column>, '') will return either the column's value (if not
NULL) or the empty string which can then be used for concatenation.

Stephan



pgsql-hackers by date:

Previous
From: Jose Soares
Date:
Subject: Re: [HACKERS] empty concatenate
Next
From: Karel Zak - Zakkr
Date:
Subject: Re: [HACKERS] empty concatenate