Re: Backup strategies - Mailing list pgsql-performance

From Ivan Voras
Subject Re: Backup strategies
Date
Msg-id gd4gp6$f4p$1@ger.gmane.org
Whole thread Raw
In response to Re: Backup strategies  (Jesper Krogh <jesper@krogh.cc>)
Responses Re: Backup strategies  (Guillaume Lelarge <guillaume@lelarge.info>)
List pgsql-performance
Jesper Krogh wrote:
> Ivan Voras wrote:
>> Warning: DO NOT do on-the-fly binary backups without snapshots.
>> Archiving the database directory with tar on a regular file system,
>> while the server is running, will result in an archive that most likely
>> won't work when restored.
>
> Even if you do a "pg_start_backup/pg_stop_backup" as specified here:
>
> http://www.postgresql.org/docs/8.3/interactive/continuous-archiving.html
> => Making a Base backup.
>
> ??
>
> It worked when I tested it, but I may just have been darn lucky.

No, it should be ok - I just didn't catch up with the times :) At least
that's my interpretation of this paragraph in documentation:

"""Some backup tools that you might wish to use emit warnings or errors
if the files they are trying to copy change while the copy proceeds.
This situation is normal, and not an error, when taking a base backup of
an active database; so you need to ensure that you can distinguish
complaints of this sort from real errors..."""

It looks like PostgreSQL freezes the state of the "data" directory in
this case (and new data goes only to the transaction log - pg_xlog),
which effectively creates an application-level snapshot. Good to know.


Attachment

pgsql-performance by date:

Previous
From: Jesper Krogh
Date:
Subject: Re: Backup strategies
Next
From: Guillaume Lelarge
Date:
Subject: Re: Backup strategies