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 1m97yU-0001XF-AK for pgsql-docs@arkaria.postgresql.org; Thu, 29 Jul 2021 15:29:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m97yT-000483-8T for pgsql-docs@arkaria.postgresql.org; Thu, 29 Jul 2021 15:29:29 +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 1m97yT-00047v-2J for pgsql-docs@lists.postgresql.org; Thu, 29 Jul 2021 15:29:29 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m97yQ-000261-V7 for pgsql-docs@lists.postgresql.org; Thu, 29 Jul 2021 15:29:28 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1m97yP-0007xk-5w; Thu, 29 Jul 2021 11:29:25 -0400 Date: Thu, 29 Jul 2021 11:29:25 -0400 From: Bruce Momjian To: Daniel Gustafsson Cc: jim@jdoherty.net, pgsql-docs@lists.postgresql.org Subject: Re: Another pg_dump using split and gzip for large databases Message-ID: <20210729152925.GJ9600@momjian.us> References: <162653459215.701.6323855956817776386@wrigleys.postgresql.org> <20210728234605.GA9600@momjian.us> <20210729145855.GF9600@momjian.us> <247A4697-C00B-47A9-851A-D213CA83A378@yesql.se> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="C+ts3FVlLX8+P6JN" Content-Disposition: inline In-Reply-To: <247A4697-C00B-47A9-851A-D213CA83A378@yesql.se> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --C+ts3FVlLX8+P6JN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 29, 2021 at 05:23:20PM +0200, Daniel Gustafsson wrote: > > On 29 Jul 2021, at 16:58, Bruce Momjian wrote: > > > OK, I can adjust it to say "GNU split" or just skip this addition. > > I don't have strong feelings either way, with a slight preference for writing > it as "GNU split" since it's still a good tip for a large amount of readers. Yes, I am on the fence for the same reasons but lean toward moving forward for your same reasons. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion. --C+ts3FVlLX8+P6JN Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="split.diff" diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 8c9186d277..62dead73ce 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -273,10 +273,10 @@ cat filename.gz | gunzip | psql split command allows you to split the output into smaller files that are acceptable in size to the underlying file system. For example, to - make chunks of 1 megabyte: + make 2 gigabyte chunks: -pg_dump dbname | split -b 1m - filename +pg_dump dbname | split -b 2G - filename Reload with: @@ -284,6 +284,15 @@ pg_dump dbname | split -b 1m - cat filename* | psql dbname + + If using GNU split, it is possible to + use it and gzip together: + + +pg_dump dbname | split -b 2G --filter='gzip > $FILE.gz' + + + It can be restored using zcat. --C+ts3FVlLX8+P6JN--