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

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 (view raw or flat)
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

pgsql-bugs by date

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

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