From: Tom Lane <tgl@sss.pgh.pa.us>
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)
Date: Fri, 10 Nov 2006 11:21:55 -0500
Message-ID: <21787.1163175715@sss.pgh.pa.us> (raw)
In-Reply-To: <ej28g0$1fuc$1@news.hub.org>
References: <ej28g0$1fuc$1@news.hub.org>
Stijn Vanroye <s.vanroye@easytowork.nl> writes:
> select
> <some fields>,
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: tgl@sss.pgh.pa.us, s.vanroye@easytowork.nl
Subject: Re: Curious Join issue causing an E_FAIL error (with odbc version 8.2.2.0)
In-Reply-To: <21787.1163175715@sss.pgh.pa.us>
References: <ej28g0$1fuc$1@news.hub.org> <21787.1163175715@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox