concat(NULL,NULL) returns empty string

From: Ingmar Brouns <swingi(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: concat(NULL,NULL) returns empty string
Date: 2011-12-08 15:57:09
Message-ID: CA+77E=ZH9qn6bTZQY4rXTH_WmrJjHUGPErcKtkPsWFHrAwaMiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2011-12-08 16:03:43 Re: concat(NULL,NULL) returns empty string
Previous Message Merlin Moncure 2011-12-08 15:29:28 Re: Hope for a new PostgreSQL era?