November 2019
Beginner to intermediate
470 pages
11h 59m
English
Having a backup is pointless unless you have tried to actually replay it. Fortunately, this is easy to do. If you have created a plaintext backup, simply take the SQL file and execute it. The following example shows how that can be done:
psql your_db < your_file.sql
A plaintext backup is simply a text file containing everything. We can always simply replay a text file.
If you have decided on a custom format or directory format, you can use pg_restore to replay the backup. Additionally, pg_restore allows you to do all kinds of fancy things, such as replaying just part of a database and so on. In most cases, however, you will simply replay the entire database. In this example, we will create an empty database and just replay ...
Read now
Unlock full access