Speed up batch insertion when using PostgreSQL.