From jaltamirano@correolux.com.mx Fri Jun 5 04:52:20 2026 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A7A87DA547 for ; Fri, 11 Nov 2005 19:04:31 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 05141-08 for ; Fri, 11 Nov 2005 23:04:28 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from CORREO.correolux.com.mx (customer-200-79-53-218.uninet-ide.com.mx [200.79.53.218]) by svr1.postgresql.org (Postfix) with ESMTP id 02EF0DA4D3 for ; Fri, 11 Nov 2005 19:04:28 -0400 (AST) Received: from 192.168.7.58 ([192.168.7.58]) by correolux.com.mx with MailEnable ESMTP; Fri, 11 Nov 2005 17:05:37 -0600 Subject: pg_dump From: Judith Altamirano Figueroa To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary="=-1kDgssVLilPElZsRqmGv" Date: Fri, 11 Nov 2005 17:04:47 -0600 Message-Id: <1131750287.21260.117.camel@Desarrollo> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.023 required=5 tests=[AWL=0.022, HTML_MESSAGE=0.001] X-Spam-Score: 0.023 X-Spam-Level: X-Archive-Number: 200511/108 X-Sequence-Number: 23359 --=-1kDgssVLilPElZsRqmGv Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi how could I restore a db if I did next: pg_dump -Z 9 soi > $DESTINO/soi.bkp Thanks in advanced --=-1kDgssVLilPElZsRqmGv Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Hi

how could I restore a db if I did next:

    pg_dump -Z 9 soi > $DESTINO/soi.bkp

Thanks in advanced --=-1kDgssVLilPElZsRqmGv-- From olly@lfix.co.uk Fri Jun 5 04:52:20 2026 X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0F409D7E67; Tue, 15 Nov 2005 08:01:08 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20231-09; Tue, 15 Nov 2005 12:01:09 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by svr1.postgresql.org (Postfix) with ESMTP id 19573DB7C7; Tue, 15 Nov 2005 08:01:04 -0400 (AST) Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by svr2.postgresql.org (Postfix) with ESMTP id 81EC9F103F; Tue, 15 Nov 2005 12:01:07 +0000 (GMT) Received: from lfix.demon.co.uk ([80.177.205.209] helo=cerberus.lfix.co.uk) by anchor-post-34.mail.demon.net with esmtp (Exim 4.42) id 1EbzUl-00094E-E6; Tue, 15 Nov 2005 12:01:03 +0000 Received: from linda.lfix.co.uk ([192.168.1.1]) by cerberus.lfix.co.uk with esmtp (Exim 4.50) id 1EbzUd-0006Eo-C9; Tue, 15 Nov 2005 12:00:55 +0000 Subject: Re: [SQL] pg_dump From: Oliver Elphick Reply-To: olly@lfix.co.uk To: Judith Altamirano Figueroa Cc: pgsql-docs@postgresql.org, pgsql-sql@postgresql.org In-Reply-To: <1131750287.21260.117.camel@Desarrollo> References: <1131750287.21260.117.camel@Desarrollo> Content-Type: text/plain Date: Tue, 15 Nov 2005 12:01:58 +0000 Message-Id: <1132056118.10188.12.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 Content-Transfer-Encoding: 7bit X-LFIX-MailScanner: Found to be clean X-LFIX-MailScanner-SpamCheck: not spam, SpamAssassin (score=-5.899, required 5, autolearn=not spam, ALL_TRUSTED -3.30, BAYES_00 -2.60) X-LFIX-MailScanner-From: olly@lfix.co.uk X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/21 X-Sequence-Number: 3331 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 @@ 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.) -- Oliver Elphick olly@lfix.co.uk 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