public inbox for [email protected]  
help / color / mirror / Atom feed
From: Oliver Elphick <[email protected]>
To: Judith Altamirano Figueroa <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: [SQL] pg_dump
Date: Tue, 15 Nov 2005 12:01:58 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <1131750287.21260.117.camel@Desarrollo>
References: <1131750287.21260.117.camel@Desarrollo>

On Fri, 2005-11-11 at 17:04 -0600, Judith Altamirano Figueroa wrote:
> Hi
> 
> how could I restore a db if I did next:
> 
>     pg_dump -Z 9 soi > $DESTINO/soi.bkp

Since you don't specify any dump format, your dump should be plain text
and is compressed with gzip, so the restore command is going to be:

  zcat $DESTINO/soi.bkp | psql -d restore_database_name -f - 

You have to create the database to restore into first.


      ------------------------------------------


[Note for documentation:
According to the psql man page:
       -Z 0..9

       --compress=0..9
              Specify  the  compression  level  to use in archive formats that
              support compression. (Currently only the custom  archive  format
              supports compression.)

However using psql -Z with no format or with "-F p" in fact produces a
gzipped file.]

This might be a suitable amendment to the docs?:
$ diff -u /tmp/pg_dump.sgml.orig /tmp/pg_dump.sgml
--- /tmp/pg_dump.sgml.orig      2005-11-15 11:50:55.000000000 +0000
+++ /tmp/pg_dump.sgml   2005-11-15 11:57:38.000000000 +0000
@@ -492,8 +492,9 @@
       <listitem>
        <para>
         Specify the compression level to use in archive formats that
-        support compression.  (Currently only the custom archive
-        format supports compression.)
+        support compression.  (Currently the tar archive
+        format does not support compression.  The plain text format is
+        compressed with gzip.)
        </para>
       </listitem>
      </varlistentry>

-- 
Oliver Elphick                                          [email protected]
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
   Do you want to know God?   http://www.lfix.co.uk/knowing_god.html





view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: [SQL] pg_dump
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox