Different behaviour of concate() and concate operator ||

From: amul sul <sul_amul(at)yahoo(dot)co(dot)in>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Different behaviour of concate() and concate operator ||
Date: 2014-04-28 12:49:08
Message-ID: 1398689348.33839.YahooMailNeo@web193503.mail.sg3.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi ALL,

I need little help to understand, text concatenation.

concat function and operator || have different behaviour, if any input is NULL.

test=# select  'abc' || NULL;
 ?column?
----------

(1 row)

test=# select concat('abc', NULL);
 concat
--------
 abc
(1 row)

It has simple reason, concat operator || use textcat() function which is STRICT.

my question is 

1. Do we required textcat to be STRICT, why?
2. textcat() is used for concat operator ||, can't it possible using concat() function?

Thanks in advance.

Regards,
Amul Sul  

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-04-28 12:55:45 Re: includedir_internal headers are not self-contained
Previous Message Robert Haas 2014-04-28 12:29:32 Re: Decrease MAX_BACKENDS to 2^16