Re: [BUGS] PostgreSQL 8.2 Bug in casting varchar to int in SELECT ... WHERE IN ( ... )

2007-10-21 Thread Dawid Kuroczko
On 10/20/07, Tom Lane <[EMAIL PROTECTED]> wrote: > "Dawid Kuroczko" <[EMAIL PROTECTED]> writes: > > What troubles me here is that surprise factor is unusally high here. > > While I understand mechanics why IN (1) works while IN (1,2) does not, > > I think random developers are going to be confused.

Re: [BUGS] PostgreSQL 8.2 Bug in casting varchar to int in SELECT ... WHERE IN ( ... )

2007-10-19 Thread Tom Lane
"Dawid Kuroczko" <[EMAIL PROTECTED]> writes: > What troubles me here is that surprise factor is unusally high here. > While I understand mechanics why IN (1) works while IN (1,2) does not, > I think random developers are going to be confused. If you're not testing against 8.3 then this argument do

Re: [BUGS] PostgreSQL 8.2 Bug in casting varchar to int in SELECT ... WHERE IN ( ... )

2007-10-19 Thread Dawid Kuroczko
On 10/19/07, Tom Lane <[EMAIL PROTECTED]> wrote: > "Heikki Linnakangas" <[EMAIL PROTECTED]> writes: > > 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

Re: [BUGS] PostgreSQL 8.2 Bug in casting varchar to int in SELECT ... WHERE IN ( ... )

2007-10-19 Thread Tom Lane
"Heikki Linnakangas" <[EMAIL PROTECTED]> writes: > 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 (...)"

Re: [BUGS] PostgreSQL 8.2 Bug in casting varchar to int in SELECT ... WHERE IN ( ... )

2007-10-19 Thread Heikki Linnakangas
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

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

2007-10-19 Thread Dawid Kuroczko
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) postgre