in reply to Stream data into Postgresql

Postgresql is "transaction" oriented. If you don't use "BEGIN" and "COMMIT", then every single statement acts like you had wrapped it in those. And COMMITs are expensive.

If you can, batch your insertions into a group of 10 or 100, and commit once for those. It'll go much, much faster.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.