Thread: Outer join bug in CVS HEAD

Outer join bug in CVS HEAD

From
Heikki Linnakangas
Date:
I just bumped into this:

postgres=# CREATE TABLE atable (id int4);
CREATE TABLE
postgres=# CREATE TABLE btable (id int4);
CREATE TABLE
postgres=# INSERT INTO atable VALUES (1),(2),(3);
INSERT 0 3
postgres=# INSERT INTO btable VALUES (1),(2),(3),(1);
INSERT 0 4
postgres=#  SELECT * FROM atable WHERE id IN
(SELECT d.id
FROM atable d LEFT JOIN btable e
ON d.id = e.id)
; id
----  1  1  2  3
(4 rows)

On 8.3 this returns correctly just three rows: 1 2 3.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


Re: Outer join bug in CVS HEAD

From
Tom Lane
Date:
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> I just bumped into this:

[ scratches head ... ]  It seems to be reordering the two joins,
which it's not supposed to do.  Will look.
        regards, tom lane