Re: concat(NULL,NULL) returns empty string - Mailing list pgsql-general

From Pavel Stehule
Subject Re: concat(NULL,NULL) returns empty string
Date
Msg-id CAFj8pRDChmYuX_a5LaYFWufUTt5gQbfNcA5hDQfHfyYA5u4P=w@mail.gmail.com
Whole thread Raw
In response to concat(NULL,NULL) returns empty string  (Ingmar Brouns <swingi@gmail.com>)
List pgsql-general
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

> Kind regards,
>
> Ingmar Brouns
>
>
>

pgsql-general by date:

Previous
From: Ingmar Brouns
Date:
Subject: concat(NULL,NULL) returns empty string
Next
From: Andrew Sullivan
Date:
Subject: Re: Hope for a new PostgreSQL era?