March 2018
Beginner to intermediate
584 pages
14h 31m
English
Use the following steps to back up a database:
> pg_dump -f chapter10.backup -F custom chapter10
We use the -f flag to specify that the backup should be placed in the chapter10.backup file. We also use the -F flag to set the format of the backup output as custom - the most flexible and compressed of pg_dump's output formats by default.
> pg_restore -f chapter10.sql chapter10.backup
After creating a backup, it is good practice to make sure that the backup is valid. We do so with the pg_restore PostgreSQL tool. The -f flag instructs pg_restore ...