Skip site navigation (1) Skip section navigation (2)

Re: BUG #3518: ERROR: IN types character varying and integer cannot be matched

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tomasz Kawczynski" <sober(dot)pl(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3518: ERROR: IN types character varying and integer cannot be matched
Date: 2007-08-06 15:17:40
Message-ID: 27657.1186413460@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Tomasz Kawczynski" <sober(dot)pl(at)gmail(dot)com> writes:
> SELECT * FROM s_skladnik WHERE kod IN (902,902)
> ERROR: IN types character varying and integer cannot be matched

> whitch is ok (ive read about this restriction in 8.2.x)

> but why after 

> SELECT * FROM s_skladnik WHERE kod IN (902)
> or
> SELECT * FROM s_skladnik WHERE kod = 902

> I dont get error but query gives me correct result ?

This inconsistency will be gone in 8.3:

regression=# select * from t1 where kod = 902;
ERROR:  operator does not exist: character varying = integer
LINE 1: select * from t1 where kod = 902;
                                   ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
regression=#

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Heikki LinnakangasDate: 2007-08-06 18:32:08
Subject: Re: BUG #3519: Postgres takes the wrong query plan resulting in performance issues
Previous:From: Tom LaneDate: 2007-08-06 15:04:37
Subject: Re: BUG #3516: Incomplete #ifdef statement in s_lock.h

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group