From 7f508f1c6b515df66d27f860b2faa7b5761fa55d Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Sun, 23 Jan 2011 23:10:15 +0200 Subject: Add 'directory' format to pg_dump. The new directory format is compatible with the 'tar' format, in that untarring a tar format archive produces a valid directory format archive. Joachim Wieland and Heikki Linnakangas --- doc/src/sgml/ref/pg_dump.sgml | 60 ++++++++++++++++++++++++++++------------ doc/src/sgml/ref/pg_restore.sgml | 13 ++++++++- 2 files changed, 55 insertions(+), 18 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index de4968c5a03..fdc4b928d54 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -76,11 +76,7 @@ PostgreSQL documentation database are to be restored. The most flexible output file format is the custom format (). It allows for selection and reordering of all archived items, and is compressed - by default. The tar format - () is not compressed and has restrictions on - reordering data when loading, but it is otherwise quite flexible; - moreover, it can be manipulated with standard Unix tools such as - tar. + by default. @@ -194,8 +190,12 @@ PostgreSQL documentation - Send output to the specified file. If this is omitted, the - standard output is used. + Send output to the specified file. This parameter can be omitted for + file based output formats, in which case the standard output is used. + It must be given for the directory output format however, where it + specifies the target directory instead of a file. In this case the + directory is created by pg_dump and must not exist + before. @@ -226,9 +226,28 @@ PostgreSQL documentation Output a custom-format archive suitable for input into pg_restore. - This is the most flexible output format in that it allows manual - selection and reordering of archived items during restore. - This format is also compressed by default. + Together with the directory output format, this is the most flexible + output format in that it allows manual selection and reordering of + archived items during restore. This format is also compressed by + default. + + + + + + d + directory + + + Output a directory-format archive suitable for input into + pg_restore. This will create a directory + with one file for each table and blob being dumped, plus a + so-called Table of Contents file describing the dumped objects in a + machine-readable format that pg_restore + can read. A directory format archive can be manipulated with + standard Unix tools; for example, files in an uncompressed archive + can be compressed with the gzip tool. + This format is compressed by default. @@ -239,13 +258,12 @@ PostgreSQL documentation Output a tar-format archive suitable for input - into pg_restore. - This output format allows manual selection and reordering of - archived items during restore, but there is a restriction: the - relative order of table data items cannot be changed during - restore. Also, tar format does not support - compression and has a limit of 8 GB on the size of individual - tables. + into pg_restore. The tar-format is + compatible with the directory-format; extracting a tar-format + archive produces a valid directory-format archive. + However, the tar-format does not support compression and has a + limit of 8 GB on the size of individual tables. Also, the relative + order of table data items cannot be changed during restore. @@ -946,6 +964,14 @@ CREATE DATABASE foo WITH TEMPLATE template0; + + To dump a database into a directory-format archive: + + +$ pg_dump -Fd mydb -f dumpdir + + + To reload an archive file into a (freshly created) database named newdb: diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml index 78606969a98..bf261af9d6d 100644 --- a/doc/src/sgml/ref/pg_restore.sgml +++ b/doc/src/sgml/ref/pg_restore.sgml @@ -79,7 +79,8 @@ filename - Specifies the location of the archive file to be restored. + Specifies the location of the archive file (or directory, for a + directory-format archive) to be restored. If not specified, the standard input is used. @@ -166,6 +167,16 @@ one of the following: + + d + directory + + + The archive is a directory archive. + + + + t tar -- cgit v1.2.3