Re: Propogating conditions into a query

Поиск
Список
Период
Сортировка
От Phil Endecott
Тема Re: Propogating conditions into a query
Дата
Msg-id 42A87D91.6040108@chezphil.org
обсуждение исходный текст
Ответ на Re: Propogating conditions into a query  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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.



В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Propogating conditions into a query
Следующее
От: Tom Lane
Дата:
Сообщение: Re: postgreSQL 7.3.8, pg_dump not able to find large o