aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2021-08-03 10:57:32 -0400
committerBruce Momjian <bruce@momjian.us>2021-08-03 10:57:32 -0400
commitcfbbb8610d17bc6d82f37a446c38b29e2a5258f4 (patch)
treeb35a9ac5b1ebda7df9c9dcdb862213cf30732709
parent8f7c8e2bef2bd2587e5d66dd20de15f3db0a6bcb (diff)
downloadpostgresql-cfbbb8610d17bc6d82f37a446c38b29e2a5258f4.tar.gz
postgresql-cfbbb8610d17bc6d82f37a446c38b29e2a5258f4.zip
doc: add example of using pg_dump with GNU split and gzip
This is only possible with GNU split, not other versions like BSD split. Reported-by: jim@jdoherty.net Discussion: https://postgr.es/m/162653459215.701.6323855956817776386@wrigleys.postgresql.org Backpatch-through: 9.6
-rw-r--r--doc/src/sgml/backup.sgml13
1 files changed, 11 insertions, 2 deletions
diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml
index 8c9186d277f..cba32b6eb3e 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,15 @@ 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>
+
+ If using GNU <application>split</application>, it is possible to
+ use it and <application>gzip</application> together:
+
+<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>