Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id AEC886321F0 for ; Tue, 18 May 2010 20:45:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 16395-04 for ; Tue, 18 May 2010 23:45:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.egcrc.net (mail.egcrc.net [63.193.204.10]) by mail.postgresql.org (Postfix) with ESMTP id 7359E632752 for ; Tue, 18 May 2010 20:45:45 -0300 (ADT) Received: from EGCRC-EX04.egcrc.org ([::1]) by EGCRC-EX03.egcrc.org ([fe80::5c82:4343:5244:a0d5%11]) with mapi; Tue, 18 May 2010 16:45:43 -0700 From: Tena Sakai To: Scott Marlowe , Tena Sakai CC: "pgsql-admin@postgresql.org" Date: Tue, 18 May 2010 16:43:18 -0700 Subject: Re: troubled by pg_dump and pg_restore Thread-Topic: [ADMIN] troubled by pg_dump and pg_restore Thread-Index: Acr24Zw0gdjoVeA/TAi3XMl6fS4cSwAAkf+V Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-Entourage/13.4.0.100208 acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201005/174 X-Sequence-Number: 34647 Many thanks, Rosser, Sam, and Scott. Regards, Tena Sakai tsakai@gallo.ucsf.edu On 5/18/10 4:26 PM, "Scott Marlowe" wrote: > (Please stick to plain text posts, as many readers can't read html or > the formatting gets screwy. This is a plain text mailing list in > general. Attachments are ok tho) >=20 > On Tue, May 18, 2010 at 5:14 PM, Tena Sakai wrote: >>=20 >> Hi Everybody, >>=20 >> I am a bit troubled by pg_dump and pg_restore.=A0 My platform is >> redhat linux, Del 64 bit hardware, running postgres 8.3.7. >> I have a database named canon and I want to move a schema full of >> tables from canon to a new database named musket.=A0 The schema I >> am interested in is called tsakai.=A0 Here's what I have done: >>=20 >> =A0 $ env | grep PG >> =A0 PGUSER=3Dpostgres >> =A0 PGDATABASE=3Dcanon >> =A0 PGHOST=3Dlocalhost >> =A0 PGDATA=3D/usr/local/pgsql/data >> =A0 $ >> =A0 $ pg_dump -n tsakai > canon_tsakai.sql >> =A0 $ >> =A0 $ echo $? >> =A0 0 >> =A0 $ >> =A0 $ pg_restore -l canon_tsakai.sql >> =A0 pg_restore: [archiver] input file does not appear to be a valid arch= ive >> =A0 $ >> =A0 $ pg_restore -d musket canon_tsakai.sql >> =A0 pg_restore: [archiver] input file does not appear to be a valid arch= ive >>=20 >> Can someone please tell me (1) if there is anything wrong with my invoca= tion >> of pd_dump?=A0 (I want to generate a file pd_restore can use to feed to >> musket database.)=A0 (2) Why pg_restore wouldn't give me listing?=A0 And= (3) >> why the second pg_restore command is upset? >=20 > pg_restore expects custom format from pg_dump. For plain sql files, use > psql: >=20 > psql mydb -f mysql.sql