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 1m8tFi-0005hW-CO for pgsql-docs@arkaria.postgresql.org; Wed, 28 Jul 2021 23:46:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m8tFe-00083w-Np for pgsql-docs@arkaria.postgresql.org; Wed, 28 Jul 2021 23:46:14 +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 1m8tFe-00083o-Gj for pgsql-docs@lists.postgresql.org; Wed, 28 Jul 2021 23:46:14 +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 1m8tFX-00032N-8J for pgsql-docs@lists.postgresql.org; Wed, 28 Jul 2021 23:46:12 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1m8tFV-0000F7-Hq; Wed, 28 Jul 2021 19:46:05 -0400 Date: Wed, 28 Jul 2021 19:46:05 -0400 From: Bruce Momjian To: jim@jdoherty.net, pgsql-docs@lists.postgresql.org Subject: Re: Another pg_dump using split and gzip for large databases Message-ID: <20210728234605.GA9600@momjian.us> References: <162653459215.701.6323855956817776386@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: <162653459215.701.6323855956817776386@wrigleys.postgresql.org> 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 --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jul 17, 2021 at 03:09:52PM +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/10/backup-dump.html > Description: > > pg_dump ccbank | split -b 2048m --filter='gzip > $FILE.gz' Wow, odd we didn't have an example of using gzip and split together; patch attached. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion. --VbJkn9YxBvnuCH5J 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..96e7f06485 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,14 @@ pg_dump dbname | split -b 1m - cat filename* | psql dbname + + It is possible to use split and gzip: + + +pg_dump dbname | split -b 2G --filter='gzip > $FILE.gz' + + + It can be restored using zcat. --VbJkn9YxBvnuCH5J--