Re: Error: Operator does not exist: "char"=integer

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Error: Operator does not exist: "char"=integer
Дата
Msg-id 87fxklkqpp.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Error: Operator does not exist: "char"=integer  (Aarni <aarni@kymi.com>)
Ответы Re: Error: Operator does not exist: "char"=integer  (Aarni <aarni@kymi.com>)
Список pgsql-general
Aarni <aarni@kymi.com> writes:

> "ERROR:  operator does not exist: character varying = integer at character 286
> HINT:  No operator matches the given name and argument type(s). You might need
> to add explicit type casts."
>
> Quick fix to sql statements eg.
>
> ... WHERE CAST (your_char AS INTEGER) = integer ...
> ... WHERE CAST (your_char AS INTEGER) IN (1,2,3,...)

Note that this is *not* what was happening in 8.2. There it was casting them
to text and doing a text comparison. In the case of integer and equality
they're probably equivalent. However < and > will behave quite differently.
That's why the casts disappeared -- you probably weren't running the queries
you thought you were running in 8.2 and previously.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

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

Предыдущее
От: Aarni
Дата:
Сообщение: Re: Error: Operator does not exist: "char"=integer
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Hi iam the beginner