[HACKERS] Different behaviour of concate() and concate operator ||

2014-04-28 Thread amul sul
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,

Re: [HACKERS] Different behaviour of concate() and concate operator ||

2014-04-28 Thread Tom Lane
amul sul sul_a...@yahoo.co.in writes: concat function and operator || have different behaviour, if any input is NULL. The behavior of || is specified by the SQL standard, and it says (SQL99 6.27 string value expression general rule 2a): a) If either S1 or S2 is the null value,

Re: [HACKERS] Different behaviour of concate() and concate operator ||

2014-04-28 Thread Greg Stark
The missing bit of context is that concat() is there because early on in Postgres's life there was an effort to have a full suite of Oracle compatibility functions. If someone suggested it now they would be pushed towards making it an extension or pointed at EDB. But things like concat are the

Re: [HACKERS] Different behaviour of concate() and concate operator ||

2014-04-28 Thread Tom Lane
Greg Stark st...@mit.edu writes: The missing bit of context is that concat() is there because early on in Postgres's life there was an effort to have a full suite of Oracle compatibility functions. If someone suggested it now they would be pushed towards making it an extension or pointed at

Re: [HACKERS] Different behaviour of concate() and concate operator ||

2014-04-28 Thread amul sul
On Monday, 28 April 2014 10:56 PM, Tom Lane t...@sss.pgh.pa.us wrote: Greg Stark st...@mit.edu writes: So they pretty much would have to make concat() treat NULL as empty. could it be problematic if I update pg_operator catalogue entry for ||,  call to concat() function instead of texcat(), in