Exporting / Importing Data With PostgreSQL

Published: 17 February 2026
on channel: Relational Databases and SQL for Beginners
96
4

In this video, you will explore the methods of exporting and importing data using PostgreSQL through the psql command line interface.
We will examine the functionality of the COPY TO and COPY FROM commands while working with a variety of file formats, including text, CSV, compressed, and binary.
Additionally, we will address the challenge of importing data that have conflicting primary and foreign keys by demonstrating how to reassign these keys.
Finally, you will learn how to effectively utilize the pg_dump and pg_restore commands to streamline your data export and import processes across multiple file formats.

gzip installations:
https://cygwin.com/install.html
Run the installation (if desired, you can install only gzip by entering 'gzip' in the search window of the installer)
In 'Environment Variables' - 'System variables' add to 'Path' Variable
For example - C:\cygwin64\bin
May require a re-boot

https://gnuwin32.sourceforge.net/pack...
Simpler installation but this is an older version of gzip
Choice of running an install (setup) or downloading the binaries in a zip file.

Text Editor (Notepad++):
https://notepad-plus-plus.org/

GitHub (code used in this video):
https://github.com/RelationalDatabase...

00:00 Overview
01:02 About CSV
01:48 Using COPY Command Overview
02:47 Exporting Using COPY Overview
04:59 Exporting Using COPY Implementation
10:19 Importing Using COPY Overview
11:27 Importing Using COPY Implementation
14:47 Re-assigning Primary/Foreign Keys for Import Overview
14:47 Re-assigning Primary/Foreign Keys for Import Implementation
22:52 Exporting/Importing Data With pgAdmin
27:42 Using pg_dump for Export Overview
30:10 Using pg_dump for Export Implementation
36:00 Importing Data From a Plain-Text SQL File Overview
36:40 Importing Data From a Non-Plain-Text SQL File Overview
38:08 Restoring SQL files
39:15 Using psql to Restore From Plain-Text SQL Files
41:08 Using pg_restore to Restore From Non-Plain-Text SQL Files
44:00 Like and Subscribe
#postgresql #postgresqltutorial #importexport


On this page of the site you can watch the video online Exporting / Importing Data With PostgreSQL with a duration of hours minute second in good quality, which was uploaded by the user Relational Databases and SQL for Beginners 17 February 2026, share the link with friends and acquaintances, this video has already been watched 96 times on youtube and it was liked by 4 viewers. Enjoy your viewing!