Search Postgresql Archives

Re: Propogating conditions into a query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tom Lane wrote:
Phil Endecott <spam_from_postgresql_general@xxxxxxxxxxxx> 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.



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
     subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
     message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux