Don't know postgres but in Oracle the fastest way (or one of them) is similar to that already suggested. Get a nice clean flat data file and use a loader utility or command.
In Oracle you'd switch off indexes and constraints and set buffers etc big enough to get lots of rows in before a commit.
After the load apply the contstaints and recreate the indices.
Comment on Re: Quickest way to insert many rows with DBI