From the course: PostgreSQL: Client Applications
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Create a backup of a single table - PostgreSQL Tutorial
From the course: PostgreSQL: Client Applications
Create a backup of a single table
- [Instructor] It's not uncommon to require a backup of only a single table from a database. Perhaps your database only has one primary data table that changes regularly. When that's the case, there's no need to make a complete backup of lookup or dimension tables or all of the other database elements that never change. We can backup a single table with the -t or --table option. We'll start with these same pg_dump command. Then I'll add the -t or --table option followed by the name of the table that we want to export. Let's create a database backup of just the sales.customers table. We'll pull it from the Two Trees Database and I'll export it using the greater than symbol to my desktop in a file called customers.SQL. I'll press enter to create that database backup. And you can also use the -t option with a pattern matching wildcard, * character. For instance to dump all of the tables in the sales schema, you can…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Create backups with pg_dump4m 9s
-
(Locked)
Configure backup options3m 36s
-
(Locked)
Data-only and schema-only backups3m 10s
-
(Locked)
Create a backup of a single table2m 51s
-
(Locked)
Restoring plain-text backups2m 38s
-
(Locked)
Custom archive backup files3m 45s
-
(Locked)
Restoring database archives with pg_restore4m 21s
-
(Locked)
Partial database restores5m 53s
-
(Locked)
-