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

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…

Contents