X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 92B75D1B342 for ; Tue, 29 Jun 2004 18:26:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31059-04 for ; Tue, 29 Jun 2004 21:25:59 +0000 (GMT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id B7E93D1B2A4 for ; Tue, 29 Jun 2004 18:25:55 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id DACD535697; Tue, 29 Jun 2004 14:25:18 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id D7F9435695; Tue, 29 Jun 2004 14:25:18 -0700 (PDT) Date: Tue, 29 Jun 2004 14:25:18 -0700 (PDT) From: Stephan Szabo To: Zoltan Boszormenyi Cc: pgsql-sql@postgresql.org Subject: Re: OUTER JOIN problem In-Reply-To: <40D9DD8F.50306@freemail.hu> Message-ID: <20040629142001.T68031@megazone.bigpanda.com> References: <40D9DD8F.50306@freemail.hu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/301 X-Sequence-Number: 18246 On Wed, 23 Jun 2004, Zoltan Boszormenyi wrote: > I don't know how PostgreSQL works internally but this bug *must* be > conforming to some standard if two distinct SQL server products behave > (almost) the same. I said almost, I discovered the same annoyance today > on an Informix 9.21 running under SCO UNIX on a slightly larger dataset > with less than 70 rows. It just left out some arbitrary rows that had > NULLs from the right side table (i.e not existing rows). It's not a bug. The outerness of the join is defined over the join conditions (the ON portion), not the where conditions. In the first case you got rows from the join that matched the join condition like (a.i=2, c.a=1, c.b=2) which the where then filtered out. I think select * from a left outer join c on (a.i=c.a and c.b=1) meets the standard and may give you what you want.