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?

Answers


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.


Need Your Help

Nesting item data in Scrapy

python json scrapy

I'm fairly new to Python and Scrapy and have issues wrapping my head around how to create nested JSON with the help of Scrapy.

Allow height% with jQuery scrollbar

javascript jquery css height jscrollbar

I am using the Malihu custom content scroller with automatic scrolling. So far, I basically am experimenting with it. I noticed when I take the height of the scrolling div and use a percentage inst...