View Single Post

   
  #1 (permalink)  
Old 04-19-2008, 04:26 PM
Tomas Doran
 
Posts: n/a
Default Potential bug in postgres 8.2.4

I'm not sure if this is a bug, or not - but it looks like one to me.

if you say:

CREATE TABLE testtable (
col1 char(1),
data text
);

INSERT INTO testtable (col1, data) VALUES ('1', 'foobar');
INSERT INTO testtable (col1, data) VALUES ('2', 'foobarbaz');

The following queries all work:
INSERT INTO testtable (col1, data) VALUES (3::int, 'foobarbazquux');
SELECT * FROM testtable WHERE col1 = 3::int;
SELECT * FROM testtable WHERE col1 IN (1);
SELECT * FROM testtable WHERE col1 IN (1::int);

However these querys fail on 8.2.4, but work correctly on 8.1:
SELECT * FROM testtable WHERE col1 IN (1::int, 2::int);
SELECT * FROM testtable WHERE col1 IN (1, 2);

I could understand if the behavior was the same for single element IN
clauses, and multiple element IN clauses - however as their behavior
is different, and it used to work in 8.1....

Cheers
Tom

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Reply With Quote