looping function call with commit
I have a plpgsql function which updates table data. I want to call this function within a loop passing the looping variable as an argument, and commit after each function call.
I tried to make another plpgsql function, but I figured out that i can't do commit in a function unlike oracle procedure.
Is there a way to do this in a regular sql editor or psql?
Well, you can, but you have to use the dblink-extension to make an external connection to your database. A lot of overhead, will be slower, but it works. Maybe this will do for your situation.