concat(NULL,NULL) returns empty string

Started by Ingmar Brounsover 14 years ago2 messagesgeneral
Jump to latest
#1Ingmar Brouns
swingi@gmail.com

Hi,

The documentation of the function concat states: Concatenate all arguments.
NULL arguments are ignored.
Intuitively I would expect that

concat(NULL, NULL) IS NULL

but this is not the case as it equals the empty string. As no empty string
was passed, the empty string seems
to come from nowhere. I found this behavior not immediately clear from the
documentation..

Kind regards,

Ingmar Brouns

#2Pavel Stehule
pavel.stehule@gmail.com
In reply to: Ingmar Brouns (#1)
Re: concat(NULL,NULL) returns empty string

Hello

2011/12/8 Ingmar Brouns <swingi@gmail.com>:

Hi,

The documentation of the function concat states: Concatenate all arguments.
NULL arguments are ignored.
Intuitively I would expect that

concat(NULL, NULL) IS NULL

but this is not the case as it equals the empty string. As no empty string
was passed, the empty string seems
to come from nowhere. I found this behavior not immediately clear from the
documentation..

yes - it returns empty string - concat is "barier" to nulls

it should be better documented

Regards

Pavel Stehule

Show quoted text

Kind regards,

Ingmar Brouns