Обсуждение: Unique operator error w/ concatenation

Поиск
Список
Период
Сортировка

Unique operator error w/ concatenation

От
Wells Oliver
Дата:
Folks, experiencing an odd issue. The following on an 8.4 server: select 'foo'::text || 123

Blows up, saying:

ERROR:  operator is not unique: text || integer
LINE 1: select 'fo'::text || 123;
                          ^
HINT:  Could not choose a best candidate operator. You might need to add explicit type casts.

But on another postgres 8.4 server, it properly returns a concatenated string.

Any tips on how/where I can track down why/where there might be duplicate operators?

--
Wells Oliver
Architect, Baseball Systems
619-795-5359
San Diego Padres | 100 Park Boulevard | San Diego CA 92101


Re: Unique operator error w/ concatenation

От
Tom Lane
Дата:
Wells Oliver <woliver@padres.com> writes:
> Folks, experiencing an odd issue. The following on an 8.4 server: select 'foo'::text || 123
> Blows up, saying:

> ERROR:  operator is not unique: text || integer
> LINE 1: select 'fo'::text || 123;
>                           ^
> HINT:  Could not choose a best candidate operator. You might need to add explicit type casts.

> But on another postgres 8.4 server, it properly returns a concatenated string.

> Any tips on how/where I can track down why/where there might be duplicate operators?

psql's "\do ||" might help.  Presumably somebody's stuck a user-defined
operator named || into that database ...

            regards, tom lane