Re: concat(NULL,NULL) returns empty string

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Ingmar Brouns <swingi(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: concat(NULL,NULL) returns empty string
Date: 2011-12-08 16:03:43
Message-ID: CAFj8pRDChmYuX_a5LaYFWufUTt5gQbfNcA5hDQfHfyYA5u4P=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

2011/12/8 Ingmar Brouns <swingi(at)gmail(dot)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
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2011-12-08 16:04:28 Re: Hope for a new PostgreSQL era?
Previous Message Ingmar Brouns 2011-12-08 15:57:09 concat(NULL,NULL) returns empty string