X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B5706D1C952 for ; Fri, 1 Aug 2003 16:05:53 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 53864-05 for ; Fri, 1 Aug 2003 13:04:45 -0300 (ADT) Received: from jal.clueinc.net (xd84b436b.ip.e-nt.net [216.75.67.107]) by svr1.postgresql.org (Postfix) with ESMTP id 915A3D1C92D for ; Fri, 1 Aug 2003 13:05:51 -0300 (ADT) Received: from jal.clueinc.net (localhost [127.0.0.1]) by jal.clueinc.net (8.12.9/8.12.9/Debian-5) with ESMTP id h71H2hA9025787 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 1 Aug 2003 12:02:44 -0500 Received: (from jal@localhost) by jal.clueinc.net (8.12.9/8.12.9/Debian-5) id h71H2het025785; Fri, 1 Aug 2003 12:02:43 -0500 Date: Fri, 1 Aug 2003 12:02:42 -0500 From: Jamie Lawrence To: Richard Huxton Cc: pgsql-sql@postgresql.org Subject: Re: Fwd: Bad Join moment - how is this happening? Message-ID: <20030801170242.GG1073@jal.clueinc.net> Mail-Followup-To: Richard Huxton , pgsql-sql@postgresql.org References: <20030730200732.GW1073@jal.clueinc.net> <200307302036.22095.dev@archonet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200307302036.22095.dev@archonet.com> Organization: clue inc X-URL: http://www.clueinc.net/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/6 X-Sequence-Number: 14622 Sorry to be slow on responses... Thanks to everyone who replies. On Wed, 30 Jul 2003, Richard Huxton wrote: > On Wednesday 30 July 2003 21:07, Jamie Lawrence wrote: > > I fully admit that I've been staring at this too long, and simply don't > > understand what is wrong. Apologies aside, any kind sql hackers who care > > to look this over will earn my undying gratitude, and a beer in the bar > > of your choice, should we ever meet. > > I'll take that beer (assuming I'm right) I think you nailed it first. You appear to be in London, which I haven't made it to in ~15 years, and mailing it is probably a bad idea. Ever make it to the NYC area? > > I appear to be getting a cartesean product when I select against the view > > 'addenda', when I want a left inner join. That is, I want documents > > records matched to addenda records only when there is a record in > > d_addenda with a documents_id that matches the id field in documents. > > I think this is the "adding a table into the FROM" feature of PG. You're > referring to documents.xxx in the select and d.id in the FROM. PG tries to > help out by adding the table into the FROM for you - hence cartesian join. > > I think you can turn this "feature" off in the config file in 7.3.x (haven't > checked this though) This was exactly it. Thanks for the help, this was really making me crazy. -j -- Jamie Lawrence jal@jal.org anger, bargaining, depression, and, finally, acceptance