Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSTy9-0006gl-5V for pgsql-performance@arkaria.postgresql.org; Tue, 25 Mar 2014 16:12:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WSTy8-0008JM-LG for pgsql-performance@arkaria.postgresql.org; Tue, 25 Mar 2014 16:12:52 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSTy7-0008JF-8L for pgsql-performance@postgresql.org; Tue, 25 Mar 2014 16:12:51 +0000 Received: from mail.simkin.ca ([72.51.27.125]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSTy4-0001IX-BU for pgsql-performance@postgresql.org; Tue, 25 Mar 2014 16:12:50 +0000 Received: from vpn.reinvent.com (services.reinvent.com [72.51.27.50]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.simkin.ca (Postfix) with ESMTPSA id 4EB5A27018D for ; Tue, 25 Mar 2014 09:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simkin.ca; s=default; t=1395763967; bh=AuNdjRdhs157upOEPPtGMdOpbuDm3RRAk1gl2D/3zTs=; h=From:To:Subject:Date:In-Reply-To:References; b=KLApacK6Jc1QwM3dlC54k8rfd1K/0BPpkgcQMi3AwCKXCfU0A6eQUIrzfIb3vfWQQ JyeLCTVEdxcsKyUxY1Wt6P3HimVku++9EDnf9bk2EjHRjxeGcB2cgEpUone6imDfpz NsO2ZccjNhNjhOSrQq9xAtqWofi1u18i7HPP7pxM= From: Alan Hodgson To: pgsql-performance@postgresql.org Subject: Re: pg_dump vs pg_basebackup Date: Tue, 25 Mar 2014 09:12:46 -0700 Message-ID: <4859022.GjYQ53Lp8r@skynet.simkin.ca> User-Agent: KMail/4.11.5 (Linux/3.12.13-gentoo; KDE/4.11.5; x86_64; ; ) In-Reply-To: <110A59E2-9EFF-43D9-9690-CDD5B3D92697@skogoglandskap.no> References: <1395722709.28433.YahooMailNeo@web161601.mail.bf1.yahoo.com> <110A59E2-9EFF-43D9-9690-CDD5B3D92697@skogoglandskap.no> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Pg-Spam-Score: -0.5 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On Tuesday, March 25, 2014 03:48:07 PM Graeme B. Bell wrote: > Postgresql rsync backups require the DB to be shutdown during the 'second' > rsync. > > 1. rsync the DB onto the backup filesystem (produces e.g. 95-99.99% > consistent DB on the backup filesystem) 2. shut down the DB > 3. rsync the shut down DB onto the backup filesystem (synchronises the > last few files to make the DB consistent, and is usually very fast) 4. > start the DB up again > > Is there any way to notify postgres to pause transactions (and note that > they should be restarted), and flush out write buffers etc, instead of > doing a full shutdown? e.g. so that the second rsync call would bring the > backup filesystem's representation of the DB into a recoverable state > without needing to shutdown the production DB completely. > You use pg_start_backup() before rsync, and pg_stop_backup() after. And keep all your WAL log files. No need to pause transactions; whatever happens during the rsync just gets replayed during recovery (as I understand it). You do need to do a PITR restore to make use of this rsync copy. That's basically what pg_basebackup does, I believe (I haven't used it, I only do rsyncs). -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance