Re: Dynamic queries in stored procedure

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Dynamic queries in stored procedure
Дата
Msg-id 51D6D7A2.3030206@dunslane.net
обсуждение исходный текст
Ответ на Dynamic queries in stored procedure  (Greg Jaskiewicz <gryzman@gmail.com>)
Ответы Re: Dynamic queries in stored procedure  (Scott Barney <scott@calculatedsteam.com>)
Список pgsql-performance
On 07/05/2013 09:57 AM, Greg Jaskiewicz wrote:
> Hey,
>
> We have a search method that depending on search params will join 3-5 tables, craft the joins and where section. Only
problemis, this is done in rather horrible java code. So using pgtap for tests is not feasible. 
> I want to move the database complexity back to database, almost writing the query construction in the plpgsql or
pythonas stores procedure, any suggestions ? 
>
> Unfortunately PostgreSQL won't eliminate unnecessary joins from a view, so I can't just create one view and simple
codeadding where's, order by, etc. 
>
> No, I don't want to use orm.
>

It's a matter of taste. Pretty much every PL has facilities for
constructing and running dynamic sql. PLPgsql ,PLPerl, PLV8 ...

cheers

andrew




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

Предыдущее
От: Greg Jaskiewicz
Дата:
Сообщение: Dynamic queries in stored procedure
Следующее
От: Misa Simic
Дата:
Сообщение: Re: Dynamic queries in stored procedure