Dawid Kuroczko wrote: > Versions 8.0, 8.1 work fine, while version 8.2.5 (and earlier probably too): > > postgres=> CREATE TEMP TABLE test (id varchar(32)); > CREATE TABLE > postgres=> INSERT INTO test SELECT * FROM generate_series(1,100); > INSERT 0 100 > postgres=> SELECT * FROM test WHERE id IN (50); > id > ---- > 50 > (1 row) > > postgres=> SELECT * FROM test WHERE id IN (55,50); > ERROR: IN types character varying and integer cannot be matched > > This works fine in version 8.0 and 8.1.
Note that neither SELECT will work on 8.3, because we no longer have an implicit cast from integer to text. I suppose the above is an oversight in how we handle IN-clauses (starting with 8.2 an IN-clause is transformed into an "x = ANY (...)" expression), but I don't think it's worth changing. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
