Re: big problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: big problem
Дата
Msg-id 26316.1015858954@sss.pgh.pa.us
обсуждение исходный текст
Ответ на big problem  (Frank_Lupo Frank_Lupo <frank_lupo@telemail.it>)
Список pgsql-general
Frank_Lupo Frank_Lupo <frank_lupo@telemail.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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: Unable to identify an operator '=' for types 'numeric' and 'double precision'
Следующее
От: "Gregory Wood"
Дата:
Сообщение: Re: Advice for optimizing queries using Large Tables