Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 3561C9FB2CF for ; Mon, 26 Feb 2007 17:39:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 52094-10 for ; Mon, 26 Feb 2007 17:39:25 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id DE3FA9FB1BF for ; Mon, 26 Feb 2007 17:39:24 -0400 (AST) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Mon, 26 Feb 2007 21:39:23 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 26 Feb 2007 15:39:23 -0600 Subject: Re: Change Default Database From: Scott Marlowe To: Rommel the iCeMAn , pgsql-sql@postgresql.org In-Reply-To: <00c001c759e8$0b124560$b364a8c0@theport.com> References: <00c001c759e8$0b124560$b364a8c0@theport.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1172525963.20651.39.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Mon, 26 Feb 2007 15:39:23 -0600 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.018 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_PASS, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200702/272 X-Sequence-Number: 27606 On Mon, 2007-02-26 at 14:52, Rommel the iCeMAn wrote: > Hi again, > > Apologies for the HTML. > > This is an SQL script, it was generated by doing a schema-only database dump > using pgAdminIII (which in turn uses pgdump I believe). I've attached the > entire script. I was attempting to run this script in pgAdminIII because > that's what I used to generate it, but the more I read it seems I should try > the psql command line tool to execute this script. I'm getting the > impression that pgAdmin doesn't recognize the /connect directive. Please CC the list, as more eyes are more likely to have an answer than just mine... Yeah, I always run my scripts from psql, often called from a bash shell script. That way I can substitute server / database names in the shell script depending on what I'm trying to do. \ commands exist within the framework of psql, not outside. If pgAdmin doesn't have an equivalent type of command structure, then it won't work for this. You could always drop the db by hand, create it, connect to it, and THEN run the rest of your script, but I too think it would be easier to just run the script against psql.