Re: big problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Frank_Lupo Frank_Lupo <frank_lupo(at)telemail(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: big problem
Date: 2002-03-11 15:02:34
Message-ID: 26316.1015858954@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Frank_Lupo Frank_Lupo <frank_lupo(at)telemail(dot)it> writes:
> select 'aaa'+'aaa';
> return :
> ?column?
> ----------
> ?

"+" is not the operator for concatenation. Use the SQL-standard
concatenation operator, "||".

Just FYI, what you seem to be getting is coercion to type "char"
(the single-byte char, not char(N)) and then addition of character
values.

If you really insist on spelling concatenation as "+", try

create operator + (leftarg=text, rightarg=text, procedure=textcat);

This will work better than making one for varchar because text is
the preferred string type.

regards, tom lane

In response to

  • big problem at 2002-03-11 08:22:44 from Frank_Lupo Frank_Lupo

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Wood 2002-03-11 15:45:17 Re: Advice for optimizing queries using Large Tables
Previous Message Greg Sabino Mullane 2002-03-11 15:02:18 Re: Unable to identify an operator '=' for types 'numeric' and 'double precision'