Exception in Query when mixing explicit join and implicit join - Mailing list pgsql-general

From Sebastian Hennebrueder
Subject Exception in Query when mixing explicit join and implicit join
Date
Msg-id 43170981.3080406@laliluna.de
Whole thread Raw
Responses Re: Exception in Query when mixing explicit join and implicit join
List pgsql-general
Hallo,

in an existing application I got an exception and tracked it down to a
generated query from the Java OR mapping solution Hibernate
Actually I  was suprised that the query does not work and created a
simple use case to explain the problem (see and of this email).

The postgre SQL exception is:
ERROR:  relation a does not exist

It happens when a implicit join and a inner join is mixed. Do I have to
except this as a fact or is there a logical explication for this behaviour.

--
Best Regards / Viele Grüße

Sebastian Hennebrueder

----

http://www.laliluna.de

Tutorials for JSP, JavaServer Faces, Struts, Hibernate and EJB


-- the following query has a inner join and an implicit join and does
not work.
select a.name as act_name,
u.name as trainer
from
activity a,
localgroup lg,
sponsor spon
inner join tuser u on a.fk_trainer=u.id
where spon.name='Jimmy Rich'
and
spon.fk_localgroup=lg.id
and lg.fk_activity=a.id


-- implicit join passing two tables works
select a.name as act_name
from
activity a,
localgroup lg,
sponsor spon

where spon.name='Jimmy Rich'
and
spon.fk_localgroup=lg.id
and lg.fk_activity=a.id

--
Best Regards / Viele Grüße

Sebastian Hennebrueder

----

http://www.laliluna.de

Tutorials for JSP, JavaServer Faces, Struts, Hibernate and EJB

Get support, education and consulting for these technologies - uncomplicated and cheap.


pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: newbie - postgresql or mysql
Next
From: "Reid Thompson"
Date:
Subject: Re: newbie - postgresql or mysql