From 2c4fdfef503394034b7e49b88cc747196258c33b Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 3 Aug 2021 10:57:32 -0400 Subject: [PATCH] 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 --- doc/src/sgml/backup.sgml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index f0995a46cf..1cc3524402 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,15 @@ pg_dump dbname | split -b 1m - cat filename* | psql dbname + + If using GNU split, it is possible to + use it and gzip together: + + +pg_dump dbname | split -b 2G --filter='gzip > $FILE.gz' + + + It can be restored using zcat.