Обсуждение: BUG #3092: character varying and integer cannot be matched

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

BUG #3092: character varying and integer cannot be matched

От
"Andrew Rass"
Дата:
The following bug has been logged online:

Bug reference:      3092
Logged by:          Andrew Rass
Email address:      net-flight@gmx.net
PostgreSQL version: 8.2.3
Operating system:   FreeBSD 6.2
Description:        character varying and integer cannot be matched
Details:

Hello the following problem has occured,

SELECT T055.MESOPRIM,T051.MESOPRIM FROM T055 T055,T051 T051
WHERE T055.MESOYEAR = 1278 AND T055.MESOCOMP = '1ZAP'
AND T051.MESOYEAR = 1278 AND T051.MESOCOMP = '1ZAP'
AND ( T055.C002 = T051.C001 AND T055.C004 IN (2,3)
AND lower(t051.c052)  LIKE '%frankfurt%' )ORDER BY T055.C002


ERROR: IN types character varying and integer cannot be matched
SQL Status:42804

mesoprim character varying(34);
mesoyear integer;
mesocomp character varying(4);
c002 character varying(20);
c001 character varying(20);

postgresql 7.4.7 did this
and now it did this problem like describe

thank you

Re: BUG #3092: character varying and integer cannot be matched

От
Peter Eisentraut
Дата:
Andrew Rass wrote:
> ERROR: IN types character varying and integer cannot be matched
> SQL Status:42804

Please provide the complete table definitions necessary to reproduce the
problem.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: BUG #3092: character varying and integer cannot be matched

От
Tom Lane
Дата:
"Andrew Rass" <net-flight@gmx.net> writes:
> ERROR: IN types character varying and integer cannot be matched

> postgresql 7.4.7 did this
> and now it did this problem like describe

This is not a bug; it's an intentional tightening of the behavior.
You'll need to put in a cast so that the system knows whether you want
an integer comparison or a textual comparison to occur.

            regards, tom lane