Re: [PERFORM] Dynamic queries in stored procedure

2013-07-05 Thread Scott Barney
I do this all the time; In fact, I've written a dynamic aggregate engine that uses a sudo bind variable technique & dynamic joins with dependency injection because the table names and query logic are not known at run time - all in plpgsql. sb On 7/5/2013 9:26 AM, Andrew Dunstan wrote: On 07/

Re: [PERFORM] Dynamic queries in stored procedure

2013-07-05 Thread Misa Simic
2013/7/5 Greg Jaskiewicz > Hey, > > We have a search method that depending on search params will join 3-5 > tables, craft the joins and where section. Only problem is, this is done in > rather horrible java code. So using pgtap for tests is not feasible. > I want to move the database complexity b

Re: [PERFORM] Dynamic queries in stored procedure

2013-07-05 Thread Andrew Dunstan
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 problem is, this is done in rather horrible java code. So using pgtap for tests is not feasible. I want to move the databas

[PERFORM] Dynamic queries in stored procedure

2013-07-05 Thread Greg Jaskiewicz
Hey, We have a search method that depending on search params will join 3-5 tables, craft the joins and where section. Only problem is, 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