ETL Example—Load

Learn how to load data into a PostgreSQL database from the shell.

The last step in the ETL pipeline is to load the cleaned and processed data stored in clean_data.csv into a PostgreSQL database.

Connecting to the database

First, we create a Bash script called load_data.sh that will switch users from “root” to “postgres,” start a Postgres database, and run an SQL script to load the data. The SQL script will be stored in a file called load_data.sql.

Get hands-on with 1200+ tech skills courses.