External loading programs
Another thing to be aware of is that COPY will abort all its work if it finds any error in the input data. This can be frustrating if the bad row is near the end of a large input. If you're importing from an external data source (a dump out of a non-PostgreSQL database, for example), you should consider a loader that saves rejected rows while continuing to work anyway, like pgloader, (http://pgfoundry.org/projects/pgloader/). pgloader will not be as fast as COPY, but it's easier to work with on dirty input data and it can handle more types of input formats, too.
Another loader useful for some special cases is pg_bulkload. It can be even faster than straight COPY. This is due to very aggressive performance features, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access