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

From Ingmar Brouns
Subject concat(NULL,NULL) returns empty string
Date
Msg-id CA+77E=ZH9qn6bTZQY4rXTH_WmrJjHUGPErcKtkPsWFHrAwaMiQ@mail.gmail.com
Whole thread Raw
Responses Re: concat(NULL,NULL) returns empty string
List 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



pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Hope for a new PostgreSQL era?
Next
From: Pavel Stehule
Date:
Subject: Re: concat(NULL,NULL) returns empty string