postgreSQL Compress format backup
The -F option on pg_dump allows you to specify the format of the output. The default output is plain-text. That’s what you get when you do this: pg_dump bacula > bacula.sql and is functionally equivalent to doing: pg_dump -Fp bacula > bacula.sql There are other formats (directory, tar), but today I’m concerned with the custom (c) option. By default, this output is also compressed (see the -Z option). What is of most value is the ability to use pg_restore with the custom output. What’s the big deal about custom format? The more interesting option on pg_restore was -j. This allows you to run multiple concurrent jobs for the loading of data and building of indexes. This can greatly reduce the amount of time needed to restore a large database if your server has multiple processors. pg_restore can be much more useful than just doing: psql bacula < bacula.sql With pg_restore you can be very selective about what you restore. See the -L and -l options. How much do
Comments
Post a Comment