Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit cfbbb86

Browse files
committed
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
1 parent 8f7c8e2 commit cfbbb86

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

doc/src/sgml/backup.sgml

+11-2
Original file line numberDiff line numberDiff line change
@@ -273,17 +273,26 @@ cat <replaceable class="parameter">filename</replaceable>.gz | gunzip | psql <re
273273
The <command>split</command> command
274274
allows you to split the output into smaller files that are
275275
acceptable in size to the underlying file system. For example, to
276-
make chunks of 1 megabyte:
276+
make 2 gigabyte chunks:
277277

278278
<programlisting>
279-
pg_dump <replaceable class="parameter">dbname</replaceable> | split -b 1m - <replaceable class="parameter">filename</replaceable>
279+
pg_dump <replaceable class="parameter">dbname</replaceable> | split -b 2G - <replaceable class="parameter">filename</replaceable>
280280
</programlisting>
281281

282282
Reload with:
283283

284284
<programlisting>
285285
cat <replaceable class="parameter">filename</replaceable>* | psql <replaceable class="parameter">dbname</replaceable>
286286
</programlisting>
287+
288+
If using GNU <application>split</application>, it is possible to
289+
use it and <application>gzip</application> together:
290+
291+
<programlisting>
292+
pg_dump <replaceable class="parameter">dbname</replaceable> | split -b 2G --filter='gzip > $FILE.gz'
293+
</programlisting>
294+
295+
It can be restored using <command>zcat</command>.
287296
</para>
288297
</formalpara>
289298

0 commit comments

Comments
 (0)