Skip to content

Commit 924e1d0

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 fb23408 commit 924e1d0

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

doc/src/sgml/backup.sgml

Lines changed: 11 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy