Re: swap relations to be able to execute a left join

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: swap relations to be able to execute a left join
Date: 2005-12-09 17:25:44
Message-ID: 20051209172544.GD5059@merkur.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Dec 09, 2005 at 09:16:15AM -0800, David Rio Deiros wrote:

> The other day, a coworker who loves mysql was complaining to me because
> he had a hard time to find out why this query didn't work on PostgreSQL:
...
> FROM
> Artifact_Revisions AR,
> Revisions_to_Types RTT,
> Artifact_Types AT
> LEFT JOIN
> Users U
> on (U.user_id = AR.principal_user_id)
...
> Apparently, once he swapped the 1st (AR) and the 3rd (AT) relation in
> the FROM, the query worked.
...
> I am sure there is a good reason why you have to swap the relations
> in PostgreSQL. Anyone?

I should think his query is joining something other than
what he *thinks* it does...

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Browse pgsql-general by date

  From Date Subject
Next Message William 2005-12-09 17:28:07 Re: PgSQL 8.1.0 Solaris w/ Sun's cc
Previous Message Tom Lane 2005-12-09 17:16:57 Re: Solaris 10 Sun Studio 11 compile error configtest