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 3560E32A0CF for ; Thu, 7 Oct 2004 19:44:37 +0100 (BST) 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 65921-04 for ; Thu, 7 Oct 2004 18:44:25 +0000 (GMT) Received: from lakermmtao05.cox.net (lakermmtao05.cox.net [68.230.240.34]) by svr1.postgresql.org (Postfix) with ESMTP id 407F0329EC3 for ; Thu, 7 Oct 2004 19:44:24 +0100 (BST) Received: from [192.168.123.110] (really [68.225.208.56]) by lakermmtao05.cox.net (InterMail vM.6.01.03.04 201-2131-111-106-20040729) with ESMTP id <20041007184424.CKKS334.lakermmtao05.cox.net@[192.168.123.110]>; Thu, 7 Oct 2004 14:44:24 -0400 Mime-Version: 1.0 X-Sender: usachurch@mail.absolutemotion.com Message-Id: In-Reply-To: <28920.1097162275@sss.pgh.pa.us> References: <1790.1097106631@sss.pgh.pa.us> <28920.1097162275@sss.pgh.pa.us> Date: Thu, 7 Oct 2004 11:44:21 -0700 To: pgsql-admin@postgresql.org From: admin@usachurch.com Subject: Re: problems with pg_dump and pg_restore Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200410/119 X-Sequence-Number: 15112 > > pg_restore -U admin -C -d staging /home/postgres/staging-dump >> pg_restore: [archiver (db)] could not execute query: ERROR: database >> "staging" already exists > >-C tells it to create (and then connect to) the target DB, rather than >connect to an existing DB and restore into that. So generally you want >to say "-d template1" (or some other existing DB) when you use -C. Tom, But if I first "dropdb -U admin staging", and then issue: pg_restore -U admin -C -d staging /home/postgres/staging-dump I get the error: pg_restore: [archiver (db)] connection to database "staging" failed: FATAL: database "staging" does not exist Yet the docs state that the above command should Create the database named by the "-d staging" part of the command. I'm confused as to why that doesn't work. I also am not sure what the template1 and template0 are there for. Regards, Devin