Loading and Extracting Data With Tables

In the previous lessons of this Postgres course, we've been exploring PostgreSQL, and we have been mostly concerned with the different datatypes and their impact on performance when querying tables. 

In this mission, you will evaluate the performance of loading data as well as extracting data to and from Postgres tables. Specifically, you will learn how to insert multiple values in a table at once as well as how to copy a Postgres table into a file. You will also learn more about the `cursor.execute` method and how it converts Python types into Postgres types.

While learning how to loading data with Postgres tables, you will continue to work on the IGN reviews dataset that contains reviews from games.

Knowing how to load and extract data tables with tables in Postgres is an important skill for anyone with an interest in data engineering, and as you learn you’ll be applying each new skill in our browser-based coding environment to ensure you can implement everything you’re learning.


  • Learn the process of loading data into Postgres tables
  • Learn how to extract Postgres data and clean it

Mission Outline

1. The Mogrify Method
2. The Connection Encoding
3. Inserting with Mogrify
4. Postgres Copy Method
5. The COPY statement
6. Which method is faster?
7. Extracting Table to CSV File
8. Making a Copy of a Table
9. Copy with Insert and Select
10. Next steps
11. Takeaways


Course Info:


The median completion time for this course is 5.2 hours. View Details

This course requires a premium subscription. This course includes five missions, one installation tutorial and one guided project.  It is the first course in the Data Engineer path.


Take a Look Inside

(function(d) { d.addEventListener("DOMContentLoaded", function() { var pathname = d.location.pathname.replace(/^[/]|[/]$/g, "").replace("/", "-"); var tags = d.getElementsByTagName("iframe"); var type = pathname.startsWith("course") ? "?course=" : pathname.startsWith("path") ? "?path=" : null; if (type) { var i; for (i = 0; i < tags.length; i++) { if (tags[i].src.indexOf("signup#iframe") !== -1) { tags[i].src = tags[i].src.replace("#iframe", "") + type + pathname + "#iframe"; } } } }, false); })(document);