Im using the same...
FOR record_or_row IN query LOOP
at the beginning of a function and at the end of a function. Is therea way to save the query results in a RECORD[] type so that I don'thave to run the query twice?