Re: Bug or stupidity

From: Philip Hofstetter <phofstetter(at)sensational(dot)ch>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Bug or stupidity
Date: 2004-10-23 14:35:20
Message-ID: 417A6C28.3060903@sensational.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Martijn van Oosterhout wrote:
>>popscan_light=> select aliasa.name, aliasb.name2 from a aliasa left join
>>b aliasb using (id) order by b.name2;
>>NOTICE: adding missing FROM-clause entry for table "b"
>> name | name2
>>-------+-----------
>> gnegg | gnegglink
>> blepp | blepplink
>> gnegg | gnegglink
>> blepp | blepplink
>>(4 rows)
>
>
> See that NOTIVCE? It's telling you that it's converted your query to:

actually, I've overseen it. But then, my assumption in my mail was
correct anyway.

> select aliasa.name, aliasb.name2 from b, a aliasa left join
> b aliasb using (id) order by b.name2;

> Since you now have an unconstrained join on the B table, you get twice
> as many rows.

This is what I thought.

> As for what's SQL standard, I think by a strict definition your query
> shouldn't be allowed at all, referencing an undefined table.

This is exactly what I think too. I mean: I know I made an error in my
query. It would just have been easier to find if PostgreSQL actually had
told me so (I'm not getting those NOTICEs from PHP...).

If it's wrong, it should be disallowed, not made worse by assuming a
completely wrong thing.

Thanks for your fast response anyway.

Philip

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2004-10-23 14:41:57 Re: Bug or stupidity
Previous Message Martijn van Oosterhout 2004-10-23 14:30:23 Re: Bug or stupidity