From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Khusro Jaleel <mailing-lists@kerneljack.com>
To: pgsql-admin@postgresql.org
Subject: Re: Backing up a replication set every 30 mins
Date: Wed, 15 Feb 2012 08:48:17 -0600
Message-ID: <4F3B715102000025000455FB@gw.wicourts.gov> (raw)
In-Reply-To: <4F3BBBA6.1040707@kerneljack.com>
References: <4F3BA826.9000708@kerneljack.com>
<CANjgnBvJU-0C=eDkKf32YV2UrC+bVfsM8X=542T-Yn92p=vVEA@mail.gmail.com>
<4F3BBBA6.1040707@kerneljack.com>
Khusro Jaleel <mailing-lists@kerneljack.com> wrote:
> On 02/15/2012 12:58 PM, Vladimir Rusinov wrote:
>>
>> pg_dump won't block writes, thanks to MVCC. It may increase bloat
>> and it will block DDL operations (ALTER TABLE/etc), but if your
>> database is relatively small but have high load and you need
>> frequent backups, this may be a way to go.
> Thanks Vladimir. Would a simple script with 'pg_start_backup' and
> 'pg_stop_backup' and an rsync job or tar job in between would
> work equally well? I thought that was the better way to do it,
> rather than pg_dump?
The PITR style backup you describe doesn't cause bloat or block DDL,
and if you archive the WAL files you can restore to any point in
time following the pg_stop_backup. pg_dump just gives you a
snapshot as of the start of the dump, so if you use that you would
need to start a complete dump every 30 minutes. With PITR backups
and WAL archiving you could set your archvie_timeout to force timely
archiving (or use streaming replication if you are on 9.0 or later)
and effectively dump incremental database *activity* to stay
up-to-date.
Now, if 30 minutes of activity is more than the size of the
database, pg_dump could, as Vladimir says, still be a good
alternative.
-Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, mailing-lists@kerneljack.com
Subject: Re: Backing up a replication set every 30 mins
In-Reply-To: <4F3B715102000025000455FB@gw.wicourts.gov>
References: <4F3BA826.9000708@kerneljack.com> <CANjgnBvJU-0C=eDkKf32YV2UrC+bVfsM8X=542T-Yn92p=vVEA@mail.gmail.com> <4F3BBBA6.1040707@kerneljack.com> <4F3B715102000025000455FB@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox