Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEn3G-0007Fm-Bw for pgsql-docs@arkaria.postgresql.org; Wed, 24 Feb 2021 05:49:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lEn3F-00058U-6g for pgsql-docs@arkaria.postgresql.org; Wed, 24 Feb 2021 05:49:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEn3F-00058N-0w for pgsql-docs@lists.postgresql.org; Wed, 24 Feb 2021 05:49:33 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEn38-0003Lt-Di for pgsql-docs@lists.postgresql.org; Wed, 24 Feb 2021 05:49:32 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 442725C0109; Wed, 24 Feb 2021 00:49:25 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 24 Feb 2021 00:49:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=r1HoJfSxtKNCEDMbue6ToBg9lJF Tl86MiEU+lb0VJU4=; b=C+GDVJDmgyfz0dgkVYMayUoxifcERm+QKhJV/ATBZLs iAq5vJ02rvY9uLRjbTmPYvDh5LUPD6VodXBG8ORSA+ao0h3Xk/cm6MKFAnhHTJBR fbJop8vCYMVoolOiRMdTsM/Yq0WkD1ApilWah39NqSGzSb/dubCcasznt38qKIXG RWVAdWeiAAH3T9N9uix/d1WQ12eWiUw34Qui0eWPxtOrBQJGF3/tUxvGWNZZhU+2 dq+4ZCsAhU1BIQ9sxnYTqCgOWzsjxcB3mGD5g6cW3G5apOYYvS7z+/8K1N8/Xyz+ 5rs6PjuT7lnJ8kpthH/DCw8KoSNcg+1r5MW+VpXOfjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=r1HoJf SxtKNCEDMbue6ToBg9lJFTl86MiEU+lb0VJU4=; b=N0obQtjCwCe55ZHaBTPL7S UM7AvwG4ASkw64Xt7HK6yG2kKBzHoEm1yzsUpF7dJuYISMxFesGJVnE5of0TGbZ4 c8dbkKxwewK0jBcAwhJGwCW4RupHqPBNsqNEc9B1Tcflkgi8L0Uwq0uNSn9ib5Bh PlihTieffp0cAbeawsIfrpPZA6QUCyWS3QFnV4UOwND6skR5llEgWb7fc0JGMHrS btRH3YcWWuh+ijpxRgFXubdMAtk+jWZaHLsYlg3PpX1fVZL5p4LULvr1wUfzESWk 7tmJc5qPjexiUi7DmXFjMwxNYAIBnPn0MLv9dQR4CzFDanHYod+kbWfftOtoXH7A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeeigdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhepfffhvf fukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhi vghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnh epvdegudeuhfdtueeltedtveejheehieevueeigeelteegleejleeiueeiheegvefhnecu kfhppeduuddurddutddvrddukedtrddukeehnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id B473B24005E; Wed, 24 Feb 2021 00:49:23 -0500 (EST) Date: Wed, 24 Feb 2021 14:49:14 +0900 From: Michael Paquier To: phil@philphonic.de, pgsql-docs@lists.postgresql.org Subject: Re: incoorect restore_command Message-ID: References: <161397938841.15451.13129264141285167267@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2+gg6hdGLuxvwKOS" Content-Disposition: inline In-Reply-To: <161397938841.15451.13129264141285167267@wrigleys.postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --2+gg6hdGLuxvwKOS Content-Type: multipart/mixed; boundary="1D1QAIRzwqh4K/03" Content-Disposition: inline --1D1QAIRzwqh4K/03 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 22, 2021 at 07:36:28AM +0000, PG Doc comments form wrote: > I've been trying out saving and restoring compressed archive logs. The > restore_command stated in the docs at "25.3.6.2. Compressed Archive Logs" > ('gunzip < /mnt/server/archivedir/%f > %p') did not work for me, because the > archive_command ('gzip < %p > /var/lib/pgsql/archive/%f') alters the > filename to %f.gz On which platform please? Using a pipe with gzip does not alter the output file name where the data is pushed to. > I had to change the restore_command to 'gunzip < > /mnt/server/archivedir/%f.gz > %p'. Now, I kind of agree that compressing a file and not using a proper .gz extension for its name can be confusing. So what about the attached to tweak both archive_command and restore_command in this section of the docs? -- Michael --1D1QAIRzwqh4K/03 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="doc-archive-gz.patch" diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 3c8aaed0b6..089102a599 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1520,11 +1520,11 @@ tar -rf /var/lib/pgsql/backup.tar /var/lib/pgsql/archive/ If archive storage size is a concern, you can use gzip to compress the archive files: -archive_command = 'gzip < %p > /var/lib/pgsql/archive/%f' +archive_command = 'gzip < %p > /var/lib/pgsql/archive/%f.gz' You will then need to use gunzip during recovery: -restore_command = 'gunzip < /mnt/server/archivedir/%f > %p' +restore_command = 'gunzip < /mnt/server/archivedir/%f.gz > %p' --1D1QAIRzwqh4K/03-- --2+gg6hdGLuxvwKOS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmA16NoACgkQnvQgOdby QH3QRQ//UrO/WMfRsSYhG5hpPzaslsS9sUNji1Ro7UZpaQrJpCBvqV5jWiEik+tn OGejchjomy5jmOtnC936CMtr9oqlpLpOMVsJdsb+IKcZ8D55NQ1HRI0NOktTxVSU VltBKEik5MeSPfqaH9aXpw0gwxSDaa43m2dDpB9IU4S87jXSCKbh41Vykb12ZX2g BL//G4ID6b5HfNSJGGdotMUXaoBVNz/ujNucOXi7IqBGts9u+1ZvSBq77+KBGXnt dAX82D0c/jCGWzg4pHTfDBZOjg4+Khpic0/EXmIMga36frlB6mlh+Kvwk66bJsxF 3jT5PYv2xgvxRgflN4FV566XWLTIKRa62DCDXENSFEI0YO6vNOkNktVspcmuIw53 LTg7r2DbaCasezxMISy94ZTygfCn+gX2WcT3cEW6i8MuDIWfki3K4hYzWNs8Ug9T sRcKb3/X9t0PSdGqNUbl+RbhfUnjvnVPrXeP/spiqlEaBaflu1sUVO6NALyDmAnE s7/E1SgnUcQZrXbz3q9bOr2jRheGkgrmMsV/huDmKh3U3TP1L6TcqsC2IztO25IM cFnjlSMIluw5dHeQBNBCaRdCfbCxS/Tl7ei9RY1IrYUufZPwbErJMchm3RB/fDWq Eh6AHytAFgbGc0CW1L7/zfPcQDXuxfVInTWhUsS+uSVKP7fqz4A= =RJxK -----END PGP SIGNATURE----- --2+gg6hdGLuxvwKOS--