Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 375079FA418 for ; Fri, 10 Nov 2006 13:00:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 90377-07 for ; Fri, 10 Nov 2006 17:00:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id E2C389FA0F0 for ; Fri, 10 Nov 2006 13:00:50 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 2893B30DF4; Fri, 10 Nov 2006 18:00:49 +0100 (MET) From: Stijn Vanroye X-Newsgroups: pgsql.interfaces.odbc Subject: Re: Curious Join issue causing an E_FAIL error (with odbc version Date: Fri, 10 Nov 2006 17:55:19 +0100 Organization: Easy to Work Lines: 44 Message-ID: References: <21787.1163175715@sss.pgh.pa.us> Reply-To: s.vanroye@easytowork.nl Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) In-Reply-To: <21787.1163175715@sss.pgh.pa.us> To: pgsql-odbc@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/30 X-Sequence-Number: 8412 Tom Lane schreef: > Stijn Vanroye writes: >> select >> , >> C.id >> from >> A >> left join B on (A.fkB_id=B.id) >> left join C on (b.fkC_id=C.id) > >> The above query produces the error. >> With some trial and error I managed to avoid the error by ommitting the >> C.id field from the select. Of course this is hardly a solution since I >> need those values ;) > >> The next thing I tried was replace the C.id field with B.fkC_id (which >> have the same value since they form the join condition). No more error... > > Um, well no they don't necessarily have the same value. Since it's a > left join, C.id might read as null. You are right, I stand corrected (and ashamed). I think that in my specific case and use of the data this is not a problem, but I will have to check into that to make sure! > > Perhaps your E_FAIL was a consequence of some bit of your code not being > prepared to cope with a NULL value? I don't think that's the case. My code never came into play. I am using ADO components in delphi, maybe there is a problem with coping with null values. But, the code for these components is completely unchanged troughout all my tests (actually I think it hasn't changed since the dawn of man ;) ). In fact, all my software, as well as the data and where conditions have been exactly the same with every test case. With no changes to the query, code, data or where conditions the error manifested itself with the driver version 8.2.x, while it didn't occured when using the 8.1.x driver. Regards, Stijn Vanroye www.xillion.nl www.easytowork.nl