Re: Statement parsing problem ?

From: Chris Dunlop <chris(at)onthe(dot)net(dot)au>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Statement parsing problem ?
Date: 2004-09-15 23:46:06
Message-ID: 20040915234606.GA4531@onthe.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Replying to my own post, thanks to the assistance of Paul
Bort...

On Wed, Sep 15, 2004 at 11:43:47PM +1000, Chris Dunlop wrote:
> There seems to be a kind of statement parsing problem in 7.4.5
> (from debian postgresql-7.4.5-3, i386).
>
> Either that, or I'm missing something...
>
> \echo ------------
> \echo Error, from simply swapping the order of t2 and t3 ???
> \echo ------------
>
> select 1
> from
> t1,
> t3,
> t2
> join t4 on (t4.foo6 = t3.foo5)
> where t2.foo3 = t1.foo1
> and t3.foo4 = t1.foo2 ;

I'd always thought:

FROM t1, t2 join t3

meant:

FROM (t1, t2) join t3

but as Paul pointed out, it's actually:

FROM t1, (t2 join t3)

I.e. in the example above:

t2 join t4 on (t4.foo6 = t3.foo5)

doesn't work because there's no t3.foo5 on the left of the join.

> So is it me, or is this just a bit borken ?

It was me!

Cheers,

Chris.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2004-09-16 00:34:46 Re: PL/PgSQL "bare" function calls
Previous Message Neil Conway 2004-09-15 23:45:58 Re: PostgreSQL Core Committee Welcomes New Member