実行中の制御構造を見ることができます:
FOR record_or_row IN EXECUTE text_expression LOOP
statements
END LOOP [ label ];
次のようなもの:
...
for users in select usename from pg_user where usename <> 'postgres' loop
for simu in execute 'select id, name from '||quote_ident(users.usename)||'.simulation' loop
return next simu;
end loop;
end loop;
...