For a very long time, the Unix
tar command was one of the only methods for obtaining a full binary backup of a PostgreSQL database. This is still the case for more advanced installations which may make use of filesystem snapshots, extensively utilize tablespaces, or otherwise disrupt the included management tools. For these advanced scenarios and more,
tar is indispensable for circumventing or augmenting the provided tools.
Please refer to the Getting a basic export (Simple) recipe on preparing a
For the purposes of this example, we will assume that the database directory is
/db, and the archived files will go to
/archive. Based on this, we need to modify the