The 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:
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.