From the course: PostgreSQL: Client Applications
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Data-only and schema-only backups - PostgreSQL Tutorial
From the course: PostgreSQL: Client Applications
Data-only and schema-only backups
- [Instructor] A full database backup includes everything that you need to restore the database completely on a new server. This means it contains the fully designed table schemas and all of the data. But you can decide to backup only one component or the other with a couple of useful options. We'll start with the same pg_dump command that we've used previously. I'll connect to my local host with the user Postgres. Now you can choose to just back up the design or the schema of the database. Which can be used to restore empty tables that don't contain any data. But do include all of the column definitions, constraints and relationships. To do that you'll add the -S or --schema-only option. I'll finish the command by creating the backup of my two trees database. Then I'll save it onto my desktop in a file called two trees schema.SQL. I'll press enter. And that creates the schema only backup on my desktop. Now the opposite backup type is to just include the data. We'll start the command…
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)
-