postgres performance tuning - what to try next?
I think some of these suggestions may help, esp. using COPY instead of INSERT.

https://stackoverflow.com/questions/12206600/how-to-speed-up-insertion-performance-in-postgresql