From 7a28de20523bb695e8ec819514df82a18a7656b3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 21 Jun 2005 20:45:44 +0000 Subject: pg_dump can now dump large objects even in plain-text output mode, by using the recently added lo_create() function. The restore logic in pg_restore is greatly simplified as well, since there's no need anymore to try to adjust database references to match a new set of blob OIDs. --- doc/src/sgml/backup.sgml | 28 ++-------------------------- doc/src/sgml/installation.sgml | 10 +--------- doc/src/sgml/ref/pg_dump.sgml | 35 +++++++---------------------------- doc/src/sgml/ref/pg_dumpall.sgml | 12 +----------- doc/src/sgml/ref/pg_restore.sgml | 25 ++++++++++++------------- 5 files changed, 23 insertions(+), 87 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index cf8244679e9..ba55eb634ae 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1,5 +1,5 @@ Backup and Restore @@ -88,9 +88,7 @@ pg_dump dbname > pg_dump to dump the OIDs as well. To do this, use the command line - option. Large objects are not dumped by default, - either. See 's reference page if you - use large objects. + option. @@ -267,28 +265,6 @@ pg_dump -Fc dbname > - - - Caveats - - - For reasons of backward compatibility, pg_dump - does not dump large objects by default.large - objectbackup To dump - large objects you must use either the custom or the tar output - format, and use the - - - Please familiarize yourself with the - reference page. - - diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index b605ea23ddd..547dd6436de 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -1,4 +1,4 @@ - + <![%standalone-include[<productname>PostgreSQL</>]]> @@ -389,14 +389,6 @@ su - postgres <application>pg_dumpall</>. </para> - <para> - <application>pg_dumpall</application> does not - save large objects. Check - <![%standalone-include[the documentation]]> - <![%standalone-ignore[<xref linkend="backup-dump-caveats">]]> - if you need to do this. - </para> - <para> To make the backup, you can use the <application>pg_dumpall</application> command from the version you are currently running. For best diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index f717e6d2385..978fe29f0aa 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.77 2005/05/29 03:32:18 momjian Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.78 2005/06/21 20:45:43 tgl Exp $ PostgreSQL documentation --> @@ -60,9 +60,8 @@ PostgreSQL documentation <xref linkend="app-pgrestore"> to rebuild the database. They allow <application>pg_restore</application> to be selective about what is restored, or even to reorder the items prior to being - restored. The archive formats also allow saving and restoring - <quote>large objects</>, which is not possible in a script dump. - The archive files are also designed to be portable across + restored. + The archive file formats are designed to be portable across architectures. </para> @@ -127,17 +126,6 @@ PostgreSQL documentation </listitem> </varlistentry> - <varlistentry> - <term><option>-b</></term> - <term><option>--blobs</></term> - <listitem> - <para> - Include large objects in the dump. A non-text output format - must be selected. - </para> - </listitem> - </varlistentry> - <varlistentry> <term><option>-c</option></term> <term><option>--clean</option></term> @@ -600,14 +588,6 @@ CREATE DATABASE foo WITH TEMPLATE template0; <application>pg_dump</application> has a few limitations: <itemizedlist> - <listitem> - <para> - When dumping a single table or as plain text, <application>pg_dump</application> - does not handle large objects. Large objects must be dumped with the - entire database using one of the non-text archive formats. - </para> - </listitem> - <listitem> <para> When a data-only dump is chosen and the option @@ -660,17 +640,16 @@ CREATE DATABASE foo WITH TEMPLATE template0; </para> <para> - To dump a database called <literal>mydb</> that contains - large objects to a <filename>tar</filename> file: + To dump a database called <literal>mydb</> to a <filename>tar</filename> + file: <screen> -<prompt>$</prompt> <userinput>pg_dump -Ft -b mydb > db.tar</userinput> +<prompt>$</prompt> <userinput>pg_dump -Ft mydb > db.tar</userinput> </screen> </para> <para> - To reload this database (with large objects) to an - existing database called <literal>newdb</>: + To reload this dump into an existing database called <literal>newdb</>: <screen> <prompt>$</prompt> <userinput>pg_restore -d newdb db.tar</userinput> diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml index 857cb1a8a6a..c61ae094042 100644 --- a/doc/src/sgml/ref/pg_dumpall.sgml +++ b/doc/src/sgml/ref/pg_dumpall.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.50 2005/06/21 04:02:31 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.51 2005/06/21 20:45:43 tgl Exp $ PostgreSQL documentation --> @@ -43,16 +43,6 @@ PostgreSQL documentation groups, and access permissions that apply to databases as a whole. </para> - <para> - Thus, <application>pg_dumpall</application> is an integrated - solution for backing up your databases. But note a limitation: - it cannot dump <quote>large objects</quote>, since - <application>pg_dump</application> cannot dump such objects into - text files. If you have databases containing large objects, - they should be dumped using one of <application>pg_dump</application>'s - non-text output modes. - </para> - <para> Since <application>pg_dumpall</application> reads tables from all databases you will most likely have to connect as a database diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml index 54afdb154d9..9b2b5fc3f26 100644 --- a/doc/src/sgml/ref/pg_restore.sgml +++ b/doc/src/sgml/ref/pg_restore.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.52 2005/06/09 17:56:51 momjian Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.53 2005/06/21 20:45:43 tgl Exp $ --> <refentry id="APP-PGRESTORE"> <refmeta> @@ -44,14 +44,13 @@ </para> <para> - <application>pg_restore</application> can operate in two modes: If - a database name is specified, the archive is restored directly into - the database. (Large objects can only be restored by using such a direct - database connection.) Otherwise, a script containing the SQL - commands necessary to rebuild the database is created (and written - to a file or standard output), similar to the ones created by the - <application>pg_dump</application> plain text format. Some of the - options controlling the script output are therefore analogous to + <application>pg_restore</application> can operate in two modes. + If a database name is specified, the archive is restored directly into + the database. Otherwise, a script containing the SQL + commands necessary to rebuild the database is created and written + to a file or standard output. The script output is equivalent to + the plain text output format of <application>pg_dump</application>. + Some of the options controlling the output are therefore analogous to <application>pg_dump</application> options. </para> @@ -541,16 +540,16 @@ CREATE DATABASE foo WITH TEMPLATE template0; <title>Examples - To dump a database called mydb that contains - large objects to a tar file: + To dump a database called mydb to a tar + file: -$ pg_dump -Ft -b mydb > db.tar +$ pg_dump -Ft mydb > db.tar - To reload this database (with large objects) to an + To reload this dump into an existing database called newdb: -- cgit v1.2.3