Summary
In this chapter, we learned that PostgreSQL provides advanced tools so that we can perform backups and restorations. Backups are important because, even in a battle-tested and high-quality product such as PostgreSQL, things can go wrong: often, users may accidentally damage their data, but other times, the hardware or the software could fail miserably. Being able to restore data, partially or fully, is, therefore, very important, and every database administrator should carefully plan backup strategies.
We also learned that PostgreSQL ships with tools for both logical and physical backups. Logical backups are taken by means of reading the data from the database itself, using ordinary SQL interactions; physical backups are taken by means of cloning the PGDATA
directory, either by using operating system tools or PostgreSQL ad hoc solutions. Restoration is performed by specific tools in the case of logical backups, and by the database self-healing mechanism in the case of...