Book Image

PostgreSQL 9 Administration Cookbook - Second Edition

Book Image

PostgreSQL 9 Administration Cookbook - Second Edition

Overview of this book

Table of Contents (19 chapters)
PostgreSQL 9 Administration Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Hot physical backup and continuous archiving


This recipe describes how to set up a hot physical backup with a continuous archiving mechanism. The purpose of continuous archiving is to allow us to recover to any point in time from the time of the backup.

Note

Manually performing each step of this procedure is a great way to gain a clear understanding of PostgreSQL's backup and restore infrastructure. However, to reduce the chances of human errors, it is best practice to avoid reliance on complex activities that must be performed by a human operator. Procedures such as taking a hot physical backup or restoring it up to a given point in time are at least automated with custom scripts, and normally it is preferable to use a third-party, specialized tool because independent inspection and exposure to many users help prevent subtle bugs, which could even lead to data loss.

My (Gianni's) favorite tool is Barman, an open source command-line utility in Python written by my colleagues; you can see its...