Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1enmoy-0003jw-P3 for pgsql-general@arkaria.postgresql.org; Mon, 19 Feb 2018 14:53:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enmox-0004G5-Bh for pgsql-general@arkaria.postgresql.org; Mon, 19 Feb 2018 14:53:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1enmox-0004Fv-0V for pgsql-general@lists.postgresql.org; Mon, 19 Feb 2018 14:53:35 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1enmoq-0001Oh-22 for pgsql-general@lists.postgresql.org; Mon, 19 Feb 2018 14:53:33 +0000 Received: from Davids-iMac.local (unknown [173.169.74.224]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id D39F75466C; Mon, 19 Feb 2018 14:53:26 +0000 (UTC) Subject: Re: pgBackRest backup from standby To: Don Seiler Cc: pgsql-general@lists.postgresql.org References: From: David Steele Message-ID: <3f5aa386-32df-4ea9-51a6-ae0c918fd04f@pgmasters.net> Date: Mon, 19 Feb 2018 09:53:26 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Don, On 2/19/18 9:25 AM, Don Seiler wrote: > On Mon, Feb 19, 2018 at 8:18 AM, David Steele > wrote: > > It copies files that are not replicated from the primary so that a > primary-style backup is created. Anything that is replicated (which is > by far the bulk of the data) is copied from the standby. > > OK so all data files would be copied from standby. Can you give me an > example of the types of files that need to be copied from primary? >   Anything *not* in global (except pg_control), base, pg_tblspc, pg_xact/pg_clog, and pg_multixact are copied from the primary. For example, pg_stat is copied from the primary so these stats are preserved on a standby backup. pgBackRest uses all the same exclusions as pg_basebackup, so many dirs/files are not copied at all: pg_dynshmem, pg_notify, pg_replslot, pg_serial, pg_snapshots, pg_stat_tmp, pg_subtrans, etc. Full list here https://www.postgresql.org/docs/10/static/protocol-replication.html. > it's best to archive from the primary so a replication > failure does not affect your archiving. > > Understood, just not something I can change in production primary at the > moment. Hence looking to see about a quick one-off backup from standby. For a quick one-off, pg_basebackup is your friend. Regards, -- -David david@pgmasters.net