Exercise: The COPY Command
Practice using the COPY command to load data into a PostgreSQL database.
We'll cover the following...
We'll cover the following...
In this exercise, we’ll practice using the COPY command to load data into a PostgreSQL database. Our task is to create a table named cars and a function that loads a CSV file into it.
This function will be a part of the load step in an ETL pipeline that uses full loads. Therefore, we need to truncate the table each time we load new data.
Create a table
The CSV file called cars.csv contains a million records, and has the following format:
Our first step is to create a table to store this data. Create a table with matching ...