Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 5803DA5CB39 for ; Wed, 15 Feb 2012 10:48:39 -0400 (AST) Received: from gwmta.wicourts.gov ([165.219.244.99] helo=gw.wicourts.gov) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rxg9r-0006ng-SB for pgsql-admin@postgresql.org; Wed, 15 Feb 2012 14:48:38 +0000 Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Wed, 15 Feb 2012 08:48:21 -0600 Message-Id: <4F3B715102000025000455FB@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Wed, 15 Feb 2012 08:48:17 -0600 From: "Kevin Grittner" To: "Khusro Jaleel" , Subject: Re: Backing up a replication set every 30 mins References: <4F3BA826.9000708@kerneljack.com> <4F3BBBA6.1040707@kerneljack.com> In-Reply-To: <4F3BBBA6.1040707@kerneljack.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201202/64 X-Sequence-Number: 39124 Khusro Jaleel 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