[GENERAL] Easier string concat in PL funcs?

2007-10-03 Thread Jerry Sievers
After for the umpteenth time bashing my head against a wall developing some PL funcs that use dynamic SQL, going plain bonkers trying to build the query string; I came up with a function like the one below to take a string with placeholders, an array of values to be interpolated and a placeholder

Re: [GENERAL] Easier string concat in PL funcs?

2007-10-03 Thread Alvaro Herrera
Jerry Sievers wrote: After for the umpteenth time bashing my head against a wall developing some PL funcs that use dynamic SQL, going plain bonkers trying to build the query string; I came up with a function like the one below to take a string with placeholders, an array of values to be

Re: [GENERAL] Easier string concat in PL funcs?

2007-10-03 Thread hubert depesz lubaczewski
On Wed, Oct 03, 2007 at 11:47:26AM -0400, Jerry Sievers wrote: Question: Am I overlooking a simple way of doing this? yes. use plpython or plperl to do the job. depesz -- quicksil1er: postgres is excellent, but like any DB it requires a highly paid DBA. here's my CV! :)

Re: [GENERAL] Easier string concat in PL funcs?

2007-10-03 Thread Merlin Moncure
On 10/3/07, hubert depesz lubaczewski [EMAIL PROTECTED] wrote: On Wed, Oct 03, 2007 at 11:47:26AM -0400, Jerry Sievers wrote: Question: Am I overlooking a simple way of doing this? yes. use plpython or plperl to do the job. depesz here is a great example with pl/perl (search: printf)