Tom Lane wrote:
> Phil Endecott <spam_from_postgresql_general@chezphil.org> writes:
>>>D join (M join G on (M.g=G.id)) on (D.id=M.b) where D.id=nnn
>
> A possible workaround is to generate your query like
>
> D left join (M join G on (M.g=G.id)) on (D.id=M.b AND M.b=nnn) where D.id=nnn
I don't suppose it would work if I did
D left join (M join G on (M.g=G.id)) on (D.id=M.b)
where (D.id=nnn AND (M.b=nnn or M.b IS NULL))
would it?
Otherwise it breaks the view, and makes the calling code rather more messy.
--Phil.