Re: pg_start_backup does not actually allow for consistent, file-level backup - Mailing list pgsql-general

From Tomas Vondra
Subject Re: pg_start_backup does not actually allow for consistent, file-level backup
Date
Msg-id 55759357.7080802@2ndquadrant.com
Whole thread Raw
In response to pg_start_backup does not actually allow for consistent, file-level backup  (otheus uibk <otheus.uibk@gmail.com>)
List pgsql-general
On 06/08/15 14:45, otheus uibk wrote:
> The manual and in this mailing list, the claim is made that consistent,
> file-level backups may be made by bracketing the file-copy operation
> with the postgresql pg_start_backup and pg_stop_backup operations.  Many
> people including myself have found that in some circumstances, using
> "tar" to copy these files will result in an error if one of the data
> files changes during the tar operation. The responses to those queries
> on this mailing list are unsatisfactory ("everything is fine, trust us").

I don't really see what you find unsatisfactory on those responses?
While performing the backup, the database is running and either
modifying or even deleting the files. Tar does not expect that, and thus
emits warnings/errors. That's clearly explained in the docs, and
actually linked in one of the comments you quoted. And pg_start_backup
takes care of that.

If you don't like that, you have multiple options - stop the database
while performing the backup, perform file system level backup (e.g. lvm
snapshot) or use tools like pg_basebackup.

regards

--
Tomas Vondra                   http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-general by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: pg_start_backup does not actually allow for consistent, file-level backup
Next
From: otheus uibk
Date:
Subject: Re: pg_start_backup does not actually allow for consistent, file-level backup