From 704d7fa8005e872cbd2d4b6244a880341b45ba25 Mon Sep 17 00:00:00 2001 From: Philip Warner Date: Tue, 13 Mar 2001 14:08:18 +0000 Subject: [PATCH] Document changed features of pg_dump, including: - Large Object dumps - Compressed custom format - Requirement to use template0 when creating DB --- doc/src/sgml/backup.sgml | 56 +++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 5d1c0f3345..49e139cc6e 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1,4 +1,4 @@ - + Backup and Restore @@ -101,11 +101,11 @@ psql dbname < outfile for the pg_dump command. The database dbname will not be created by this - command, you must do that yourself before executing - psql (e.g., with createdb dbname). psql - supports similar options to pg_dump for - controlling the database server location and the user names. See + command, you must create it yourself from template0 before executing + psql (e.g., with createdb -t template0 + dbname). + psql supports similar options to pg_dump + for controlling the database server location and the user names. See its reference page for more information. @@ -130,6 +130,18 @@ pg_dump -h host1 dbname | psql -h h + + + + + The dumps produced by pg_dump are relative to template0. This means + that any languages, procedure etc added to template1 will also be + dumped by pg_dump. As a result, when restoring, if + you are using a customized template1, you must create the empty + database from template0, as in the example above. + + + @@ -236,6 +248,27 @@ cat filename.* | psql + + Use the custom dump format (V7.1). + + If PostgreSQL was built on a system with the zlib compression library + installed, the custom dump format will compress data as it writes it + to the output file. For large databases, this will produce similar dump + sizes to using gzip, but has the added advantage that the tables can be + restored selectively. The following command dumps a database using the + custom dump format: + + + +pg_dump -Fc dbname > filename + + + + See the pg_dump and pg_restore reference pages for details. + + + + @@ -258,10 +291,13 @@ cat filename.* | psql - Large objects are not handled by pg_dump. The - directory contrib/pg_dumplo of the - Postgres source tree contains a program that can - do that. + For reasons of backward compatibility, pg_dump does + not dump large objects by default. To dump large objects you must use + either custom or TAR output format, and use the -B option in + pg_dump. See the reference pages for details. + The directory contrib/pg_dumplo of the + Postgres source tree also contains a program that can + dump large objects. -- 2.40.0