Re: text + text - Mailing list pgsql-general

From David Garamond
Subject Re: text + text
Date
Msg-id 4166933D.9080308@zara.6.isreserved.com
Whole thread Raw
In response to Re: text + text  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: text + text
Re: text + text
List pgsql-general
Peter Eisentraut wrote:
>>What is "text + text" supposed to do right now?
>
> Nothing.

Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly,
the current behaviour is quite strange to me.

------------------
=# select coalesce('1'+'0','NULL');
  a
=# select coalesce('1'+'1','NULL');
  b
=# select coalesce('1'+'3','NULL');
  d
=# select coalesce('a'+'0','NULL');

=# select coalesce('a'+'1','NULL');

=# select coalesce('a'+'3','NULL');

=# select coalesce('a'+'x','NULL');
  Ù
------------------

>>What about making "text + text" as an equivalent for "text
>>|| text"? Most strongly-typed programming languages do this. And MS SQL
>>Server too, I think (CMIIW).
>
> What would this gain except for bloat?  It's not like SQL is utterly
> compatible with any programming language; users will still have to learn all
> the operators anyway.

I personally don't consider this "bloat". We already have other synonyms
  like '!=' and '<>'. '+' is very natural to mean concatenation for strings.

Anyway, either emitting an error or string concatenation is better than
the current behaviour, I think.

--
dave

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: text + text
Next
From: Bruno Wolff III
Date:
Subject: Re: interesting! a sequence clashes with data already in that table