From: Bruce Momjian <bruce@momjian.us>
To: jim@jdoherty.net
To: pgsql-docs@lists.postgresql.org
Subject: Re: Another pg_dump using split and gzip for large databases
Date: Wed, 28 Jul 2021 19:46:05 -0400
Message-ID: <20210728234605.GA9600@momjian.us> (raw)
In-Reply-To: <162653459215.701.6323855956817776386@wrigleys.postgresql.org>
References: <162653459215.701.6323855956817776386@wrigleys.postgresql.org>
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 <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
If only the physical world exists, free will is an illusion.
Attachments:
[text/x-diff] split.diff (1.4K, ../20210728234605.GA9600@momjian.us/2-split.diff)
download | inline diff:diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgmlindex 8c9186d277..96e7f06485 100644--- a/doc/src/sgml/backup.sgml+++ b/doc/src/sgml/backup.sgml@@ -273,10 +273,10 @@ cat <replaceable class="parameter">filename</replaceable>.gz | gunzip | psql <re
The <command>split</command> 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:
<programlisting>
-pg_dump <replaceable class="parameter">dbname</replaceable> | split -b 1m - <replaceable class="parameter">filename</replaceable>+pg_dump <replaceable class="parameter">dbname</replaceable> | split -b 2G - <replaceable class="parameter">filename</replaceable>
</programlisting>
Reload with:
@@ -284,6 +284,14 @@ pg_dump <replaceable class="parameter">dbname</replaceable> | split -b 1m - <rep
<programlisting>
cat <replaceable class="parameter">filename</replaceable>* | psql <replaceable class="parameter">dbname</replaceable>
</programlisting>
++ It is possible to use <command>split</command> and <application>gzip</application>:++<programlisting>+pg_dump <replaceable class="parameter">dbname</replaceable> | split -b 2G --filter='gzip > $FILE.gz'+</programlisting>++ It can be restored using <command>zcat</command>.
</para>
</formalpara>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: bruce@momjian.us, jim@jdoherty.net, pgsql-docs@lists.postgresql.org
Subject: Re: Another pg_dump using split and gzip for large databases
In-Reply-To: <20210728234605.GA9600@momjian.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox