Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 361EC9FA3A7 for ; Fri, 10 Nov 2006 12:22:19 -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 81188-06 for ; Fri, 10 Nov 2006 16:22:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 5AE3D9FB2F1 for ; Fri, 10 Nov 2006 12:22:01 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id kAAGLtsE021788; Fri, 10 Nov 2006 11:21:55 -0500 (EST) To: s.vanroye@easytowork.nl cc: pgsql-odbc@postgresql.org Subject: Re: Curious Join issue causing an E_FAIL error (with odbc version 8.2.2.0) In-reply-to: References: Comments: In-reply-to Stijn Vanroye message dated "Fri, 10 Nov 2006 17:08:27 +0100" Date: Fri, 10 Nov 2006 11:21:55 -0500 Message-ID: <21787.1163175715@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/29 X-Sequence-Number: 8411 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. Perhaps your E_FAIL was a consequence of some bit of your code not being prepared to cope with a NULL value? regards, tom lane