Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B9BE7632688 for ; Tue, 18 May 2010 20:26:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 77422-03 for ; Tue, 18 May 2010 23:26:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gy0-f174.google.com (mail-gy0-f174.google.com [209.85.160.174]) by mail.postgresql.org (Postfix) with ESMTP id BE78963224D for ; Tue, 18 May 2010 20:26:27 -0300 (ADT) Received: by gyg13 with SMTP id 13so3145150gyg.19 for ; Tue, 18 May 2010 16:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=lnHGwbuB0d2sEmnRehsnFcDj8XUMmqnZe2UKofd1jzU=; b=XUT2IFBk+Or7ykGHGQ2BffvrIciJc7wUqCnKuam41uip8Y+DMR5N59ZjClTMpRI1hs BHME5hoRHv77ODtskieKU/KWCJaFMjqDnbrnHUJVWsBuM16b69f4/x89FKArTMm735fk wrTeSVCk+Chm0v70/FCxvyEeXdQTpuimo2AY8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=JYLteu1e0L9rtx6r7Z4gCfxZ1kNqziSbGF01eohJy6ywVP0Uo01OwdQqPr7Ak7TANg kfbt3sqk8CygaK1gIYA2ONEODIEI/m8LECmdPmeYcztEw1VWTVVoqfk8haZN89qe2QZG KDyVpG82nl1tEqeaSFGevq8g/DwLot3okqKhQ= MIME-Version: 1.0 Received: by 10.151.129.12 with SMTP id g12mr8006240ybn.147.1274225184802; Tue, 18 May 2010 16:26:24 -0700 (PDT) Received: by 10.150.185.5 with HTTP; Tue, 18 May 2010 16:26:24 -0700 (PDT) In-Reply-To: <384163.64826.qm@web51901.mail.re2.yahoo.com> References: <384163.64826.qm@web51901.mail.re2.yahoo.com> Date: Tue, 18 May 2010 17:26:24 -0600 Message-ID: Subject: Re: troubled by pg_dump and pg_restore From: Scott Marlowe To: Tena Sakai Cc: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/173 X-Sequence-Number: 34646 (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) On Tue, May 18, 2010 at 5:14 PM, Tena Sakai wrote: > > Hi Everybody, > > 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: > > =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 archi= ve > =A0 $ > =A0 $ pg_restore -d musket canon_tsakai.sql > =A0 pg_restore: [archiver] input file does not appear to be a valid archi= ve > > Can someone please tell me (1) if there is anything wrong with my invocat= ion > 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? pg_restore expects custom format from pg_dump. For plain sql files, use p= sql: psql mydb -f mysql.sql