Re: conditional joins and views

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: conditional joins and views
Дата
Msg-id 200704242208.42839.peter_e@gmx.net
обсуждение исходный текст
Ответ на conditional joins and views  (Jonathan Vanasco <postgres@2xlp.com>)
Список pgsql-general
Am Dienstag, 24. April 2007 21:43 schrieb Jonathan Vanasco:
> Is it possible at all to use conditional joins in views?
>
> ie:
>     select a.* , b.* from a inner join b ON ( (a.id = b.id) AND
> (a.otherfield <> ?) )
>
> I have a few 15-20 table joins that i'd like to push into views.
> i've never wanted to push something with a conditional join into a
> view before, so am at a loss on this being a possibility.

I think what you are looking for is a parametrized view, but that doesn't
exist.

One obvious solution is to put this into a function, but that might not have
the best performance, depending on what sort of contexts you want to use the
view in.

Another option would be using prepared statements.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

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

Предыдущее
От: William Garrison
Дата:
Сообщение: postgres on Windows: PAE and max memory
Следующее
От: Ben
Дата:
Сообщение: reasonable limit to number of schemas in a database?