From 0512ec27c52401b9ed7b468e7b68ff9ebec1584e Mon Sep 17 00:00:00 2001 From: "David G. Johnston" Date: Fri, 2 Feb 2024 12:32:51 -0700 Subject: [PATCH] docs: move standalone pg_basebackup docs to file system section --- doc/src/sgml/backup.sgml | 47 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index b3468eea3c..1c5e48d6da 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -351,6 +351,29 @@ pg_dump -j num -F d -f File System Level Backup + + In constrast to the logical backup that pg_dump performs there is + also the option to perform a physical backup. + PostgreSQL provides a tool, + pg_basebackup, that can produce a similar standalone + backup to the one produced by pg_dump, though the restoration point + of the physical backup is as of when the backup ended instead of when + it began. You may also choose to roll your own solution using the tools + available in your operating system. This section describes both options. + + + + Built-In Standalone Backups + + If all you want is a simple standalone backup of your cluster at some point in time + (specifically at roughly the moment the backup ended) you can just save the archive + produced by the command. It handles, by default, + saving the write-ahead log (WAL) files produced during the backup to the archive. + + + + + Custom Physical Backups An alternative backup strategy is to directly copy the files that PostgreSQL uses to store the data in the database; @@ -462,6 +485,7 @@ tar -cf backup.tar /usr/local/pgsql/data the contents of indexes for example, just the commands to recreate them.) However, taking a file system backup might be faster. + @@ -1442,29 +1466,6 @@ restore_command = 'cp /mnt/server/archivedir/%f %p' Some tips for configuring continuous archiving are given here. - - - Standalone Hot Backups - - - It is possible to use PostgreSQL's backup facilities to - produce standalone hot backups. These are backups that cannot be used - for point-in-time recovery, yet are typically much faster to backup and - restore than pg_dump dumps. (They are also much larger - than pg_dump dumps, so in some cases the speed advantage - might be negated.) - - - - As with base backups, the easiest way to produce a standalone - hot backup is to use the - tool. If you include the -X parameter when calling - it, all the write-ahead log required to use the backup will be - included in the backup automatically, and no special action is - required to restore the backup. - - - Compressed Archive Logs -- 2.34.1