大量のデータをInsertするより、COPYコマンドを使うほうが早い。

COPY tablename (col1,col2,col3) FROM ‘/path/to/file/data.csv’ with NULL as ” CSV;

参考サイト

http://www.postgresql.jp/document/pg833doc/html/sql-copy.html

http://blog.goo.ne.jp/whitil/e/e5c21be12ab5e98a53116c048220bdbf

http://www.thinkit.co.jp/cert/compare/1/5/3.htm

http://okwave.jp/qa777662.html

http://blog.mufu.jp/2008/08/postgresqlcopycsv.html

http://yoshinba.qp.land.to/index.php?PostgreSQL