Re: BUG #3661: Missing equality comparator: string = integer

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: BUG #3661: Missing equality comparator: string = integer
Дата
Msg-id 162867790710091015u59786190j4a69aa3b1401a7ba@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #3661: Missing equality comparator: string = integer  ("David Bachmann" <david.bachmann@ersystems.ch>)
Список pgsql-bugs
>
> This does not function any more under PG 8.3-beta1:
>
> select '5'::varchar = 5;
> ERROR:  operator does not exist: character varying = integer
>
> select '5'::char = 5;
> ERROR:  operator does not exist: character = integer

you cannot compare any character type and numeric type. If you wont to
do, you have to cast to text or use function to_char or to_numeric.

>
>
> Note that this still works:
> select '5' = 5;
>

It is integer = integer. Value in apostrophes doesn't mean 100% char
or varchar in Postgres. Pg detects unknown type (in apostrophes)
accordance with know type (integer)

try:
postgres=# select '5.0'=5;
ERROR:  invalid input syntax for integer: "5a"

postgres=# select '5.0'=5;
ERROR:  invalid input syntax for integer: "5.0"
postgres=# select '5.0'=5.0;
 ?column?
----------
 t
(1 row)

> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: BUG #3661: Missing equality comparator: string = integer
Следующее
От: Robins
Дата:
Сообщение: Fwd: BUG #3662: Seems that more than one run of a functions causes an error