X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E0430D1B1DC for ; Sun, 27 Jun 2004 11:22:27 -0300 (ADT) 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 75400-08 for ; Sun, 27 Jun 2004 14:22:30 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 59127D1B1B4 for ; Sun, 27 Jun 2004 11:22:25 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i5REMSfA011768; Sun, 27 Jun 2004 10:22:29 -0400 (EDT) To: tfo@alumni.brown.edu (Thomas F. O'Connell) Cc: pgsql-admin@postgresql.org Subject: Re: pg_restore usage In-reply-to: <80c38bb1.0406211357.f9fadd6@posting.google.com> References: <80c38bb1.0406211357.f9fadd6@posting.google.com> Comments: In-reply-to tfo@alumni.brown.edu (Thomas F. O'Connell) message dated "21 Jun 2004 14:57:17 -0700" Date: Sun, 27 Jun 2004 10:22:28 -0400 Message-ID: <11767.1088346148@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/346 X-Sequence-Number: 14006 tfo@alumni.brown.edu (Thomas F. O'Connell) writes: > I transfer this file to another server, where the database db does not > exist. I try the following: > pg_restore -C -d db pg_dump20040621.pgsql > pg_restore: [archiver (db)] connection to database "db" failed: FATAL: > database "db" does not exist > What is an example of how the -C flag is intended to be used? Whatever database you name in -d has to already exist, because that's where pg_restore will initially connect. -C means to issue a CREATE DATABASE command and then reconnect to the new db. In other words, try "-C -d template1". regards, tom lane