PostgreSQL 8.2 Bug in casting varchar to int in SELECT ... WHERE IN ( ... )

From: "Dawid Kuroczko" <qnex42(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: PostgreSQL 8.2 Bug in casting varchar to int in SELECT ... WHERE IN ( ... )
Date: 2007-10-19 13:32:03
Message-ID: 758d5e7f0710190632v4742af27tfa933c1f8c21e32a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

The bug was found by Michał Wojas.

Regards,
Dawid Kuroczko

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2007-10-19 14:04:38 Re: PostgreSQL 8.2 Bug in casting varchar to int in SELECT ... WHERE IN ( ... )
Previous Message Tom Lane 2007-10-19 13:24:24 Re: creating a table with a serial column sets currval