postgreSQL Insert data using COPY
COPY is PostgreSQL's bulk-insert mechanism. It's a convenient way to transfer data between file sand tables, but it's also far faster than INSERT when adding more than a few thousand rows at a time.
Let's begin by creating sample data file.
And we need a two column table into which this data can be imported into.
Now the actual copy operation, this will create six records in the table.
Instead of using a file on disk, can insert data from stdin
Also you can copy data from a table to file as below: