[GENERAL] cursors, temp tables, dynamic sql technique (was and is: looping over a small record set over and over in a function)

2009-06-21 Thread Ivan Sergio Borgonovo
On Sun, 21 Jun 2009 10:57:51 +0800 Craig Ringer cr...@postnewspapers.com.au wrote: On Fri, 2009-06-19 at 20:23 +0200, Ivan Sergio Borgonovo wrote: If I could easily load all the dataset into an array, loop through it and then just update the computed field it would be nice... but how?

Re: [GENERAL] cursors, temp tables, dynamic sql technique (was and is: looping over a small record set over and over in a function)

2009-06-21 Thread Craig Ringer
On Sun, 2009-06-21 at 14:57 +0200, Ivan Sergio Borgonovo wrote: I think everything could be summed up as: select into t myaggregate1(field) from dataset where condition1; if(t10) then update dataset set field=myfunc1(a,b,c) where condition1; end if; select into t myaggregate2(field)

Re: [GENERAL] cursors, temp tables, dynamic sql technique (was and is: looping over a small record set over and over in a function)

2009-06-21 Thread Ivan Sergio Borgonovo
On Sun, 21 Jun 2009 21:43:16 +0800 Craig Ringer cr...@postnewspapers.com.au wrote: On Sun, 2009-06-21 at 14:57 +0200, Ivan Sergio Borgonovo wrote: I think everything could be summed up as: select into t myaggregate1(field) from dataset where condition1; if(t10) then update dataset

Re: [GENERAL] cursors, temp tables, dynamic sql technique (was and is: looping over a small record set over and over in a function)

2009-06-21 Thread Craig Ringer
On Sun, 2009-06-21 at 22:11 +0200, Ivan Sergio Borgonovo wrote: I think I really don't have a clear picture of how temp tables really work. They can be seen by concurrent transactions in the same session. Eh? In this context, what do you mean by session? Did you mean consecutive