Re: Backup strategies

From: Ivan Voras <ivoras(at)freebsd(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Backup strategies
Date: 2008-10-15 10:31:08
Message-ID: gd4gp6$f4p$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alain Roger 2008-10-15 10:43:13 user and default schema
Previous Message Andrus 2008-10-15 10:23:37 Optimizing queries with projected columns

Browse pgsql-performance by date

  From Date Subject
Next Message Guillaume Lelarge 2008-10-15 11:40:30 Re: Backup strategies
Previous Message Craig Ringer 2008-10-15 10:13:51 Re: Backup strategies