I have a loop in transaction block that creates a temporary table,updates,exports to txt file and drops table at the end of the block.
After some time I noticed that disk size was getting smaller each time loop continued.When I cancelled transaction block,disk size returned to its initial state.
How can I stop loop for allocating the disk on the following transaction ?
do
$$declare
--variables
begin
FOR r IN (SELECT ...) LOOP
CREATE TEMPORARY TABLE TEST .. ;
--UPDATE STATEMENTS
--EXPORT (COPIES TABLE INTO TXT FILE)
DROP TABLE TEST CASCADE;
END LOOP;
end$$;