Thread: Error in sql sintax

Error in sql sintax

From
Abaco informática s.a.
Date:
this sentence is accepted by postgresql sintax analizer but we think that's incorrect:
 
select * from table T where T.field = table.field_1
 
it take the result as an inner join between 'T' and 'table' which not exist ... just exists 'T'.
 
this occurs in linux versions and windows versions.
 
Thanks for your attention.
bye.
Ricardo Solanilla
 

Re: Error in sql sintax

From
Stephan Szabo
Date:
On Tue, 9 Nov 2004, [iso-8859-1] Abaco inform=E1tica s.a. wrote:

> this sentence is accepted by postgresql sintax analizer but we think
> that's incorrect:
>
> select * from table T where T.field =3D table.field_1
>
> it take the result as an inner join between 'T' and 'table' which not
> exist ... just exists 'T'.

Yes, because PostgreSQL adds defined behavior for such queries beyond that
of the spec for queries which reference tables not mentioned in the from
clause.  In recent versions this can be controlled by a runtime parameter
(add_missing_from).