Re: swap relations to be able to execute a left join - Mailing list pgsql-general

From Tom Lane
Subject Re: swap relations to be able to execute a left join
Date
Msg-id 29660.1134150439@sss.pgh.pa.us
Whole thread Raw
In response to Re: swap relations to be able to execute a left join  (Jaime Casanova <systemguards@gmail.com>)
Responses Re: swap relations to be able to execute a left join
List pgsql-general
Jaime Casanova <systemguards@gmail.com> writes:
> On 12/9/05, David Rio Deiros <driodeiros@gmail.com> wrote:
>> I am sure there is a good reason why you have to swap the relations
>> in PostgreSQL. Anyone?

> Because PostgreSQL is not broken...

> What i see in this SELECT is an LEFT JOIN between AT and U (note that
> the other relations in the FROM are separated by commas so they have
> nothing to do with LEFT JOIN) and is using a JOIN clause from a
> relation that has nothing to do with the LEFT JOIN...

Right.  MySQL apparently thinks that JOIN has the same precedence as
comma in a FROM-list, but anyone who has bothered to read the SQL
standard knows that JOIN is supposed to bind tighter than comma.
Your coworker is depending on a flat-out-incorrect behavior of MySQL.

            regards, tom lane

pgsql-general by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: swap relations to be able to execute a left join
Next
From: Michael Fuhr
Date:
Subject: Re: swap relations to be able to execute a left join