Possible bug? - Mailing list pgsql-bugs

From Ilir Gashi
Subject Possible bug?
Date
Msg-id E1Bg5qd-0001E8-00@ms2.city.ac.uk
Whole thread Raw
Responses Re: Possible bug?
List pgsql-bugs
Hello,

I saw this 'bug' reported in the Firebird SourceForge website for the
Firebird 1.0 server. They confirmed it as a bug! I tried it in PostgreSQL
7.2 (I know its an old release but I do not have a newer version installed,
and in any case I am only using the server for reserach purposes).
PostgreSQL returns no rows for either of the queries. Of course this is the
case since the attributes F1 and F2 of Table T1 are of type Char whereas
the select query is making the test with an integer value. Is this the
intended behaviour?

Firebird returns 0 rows for the first query and 1 row (values 3,3) for the
second query. I also tried it in Oracle 8.0.5 which returns 1 row for each
of the two queries. Therefore I have different results being returned from
all three servers.

Reproducible script:

CREATE TABLE T1 (F1 CHAR(4), F2 CHAR(4));

CREATE INDEX T1_F1 ON T1 (F1);

INSERT INTO T1 (F1, F2) VALUES ('001', '001');
INSERT INTO T1 (F1, F2) VALUES ('002', '002');
INSERT INTO T1 (F1, F2) VALUES ('003', '003');
INSERT INTO T1 (F1, F2) VALUES ('004', '004');


SELECT * FROM T1 WHERE F1 = 3;

F1   F2
---- ----

SELECT * FROM T1 WHERE F2 = 3;

F1   F2
---- ----

Best regards,

Ilir

--
____________________________________________

Ilir Gashi
PhD Student
Centre for Software Reliability
City University
Northampton Square, London EC1V 0HB
Tel: +44 20 7040 0273
Fax: +44 20 7040 8585
email: i.gashi@city.ac.uk
website: http://www.csr.city.ac.uk/csr_city/staff/gashi/
____________________________________________

pgsql-bugs by date:

Previous
From: James Robinson
Date:
Subject: subselect on nonexistent column succeeds!!?!
Next
From: Tom Lane
Date:
Subject: Re: Problem to increase name data length