I am coding a procedure to purge data from a table. I want to commit the data I'm purging at intervals (for example, every 1000 rows). The problem I'm encountering is that when I have
begin transaction;
commit;
statements in my plpgsql function it doesn't compile.
How can you explicitly create transactions within a plpgsql function?
Thanks,
Jed.