12.6 COPY: Bulk Loading Data from Files
Right, you’ve been dutifully inserting rows one by one or in small batches. It’s fine for a few hundred, maybe a thousand records. But you and I both know that’s not how the real world works. The real world sends you a 12-gigabyte CSV file from some mainframe and says “have this loaded by lunchtime.” You’re not going to do that with a million individual INSERT statements. You’re going to use COPY, PostgreSQL’s built-in data firehose.