Re: [GENERAL] Looping through cursor row batches

2008-10-07 Thread Henry Combrinck
Anyone know the most efficient way of FETCHing a batch of rows, and looping through them in a function? FETCHing a record at a time will work, but I was wondering whether this could be done. You're outsmarting yourself. :-) One can only try. plpgsql already does the equivalent of

[GENERAL] Looping through cursor row batches

2008-10-06 Thread Henry Combrinck
Greetings, I gather the following isn't possible (which would have been elegant and ideal): FOR rec IN FETCH 10 FROM cursor LOOP ... Anyone know the most efficient way of FETCHing a batch of rows, and looping through them in a function? FETCHing a record at a time will work,

Re: [GENERAL] Looping through cursor row batches

2008-10-06 Thread Tom Lane
Henry Combrinck [EMAIL PROTECTED] writes: Anyone know the most efficient way of FETCHing a batch of rows, and looping through them in a function? FETCHing a record at a time will work, but I was wondering whether this could be done. You're outsmarting yourself. plpgsql already does the