On Fri, Mar 10, 2006 at 09:36:16 -0500, Emi Lu <emilu@xxxxxxxxxxxxxxxxx> wrote: > Good morning, > > In a plpgsql function, I am trying to insert 900, 000 records into > several tables. I remembered people mentioned before that it is better > and more efficient to commit actions for let's say every 5000 records' > insertion. You can't do commits inside of a function. I think you are misremembering advice about not do inserts with a transaction per row which will have a lot of overhead for all of the commits. You can do savepoints inside of a function, but those are going to slow things down, not speed them up.