Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 7BC319FB84F for ; Mon, 26 Feb 2007 13:09:46 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 58951-08 for ; Mon, 26 Feb 2007 13:09:27 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.227]) by postgresql.org (Postfix) with ESMTP id 2500F9FB5AE for ; Mon, 26 Feb 2007 13:09:28 -0400 (AST) Received: by wr-out-0506.google.com with SMTP id 71so237444wri for ; Mon, 26 Feb 2007 09:09:27 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jb7QYDEvdS4KCpg8kZBcR0ZmVbC8+UvvvzWnhDY+iuTJkhZgIMymYVXYdiUtv/wJvAozXacq6Ub1JfBwkMrL5AUuGZ4e2LkPE7srHO0yBdvTsVnA20AC7ck1PY8oE/i+htVQWX7WUnZu7ema1bXKu043Oy3ca7n6lC6yYlzHXmE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=smNEFXMntvoa5rH6n+1HhNYoe6vy5IPXcukkqieucRLGeTo9EpkLv4mLW+zWie4rx2F4y1vHNd7GFgvIBH1YpopZrvUmPtv31A7VQ3WTrOkZxhXBHr+sut8Qr3/zgSG8paC7Rerc4/PnvpAvO+Osx75vWj00KeQ+HQz/etr8/ZE= Received: by 10.114.112.1 with SMTP id k1mr743500wac.1172509765000; Mon, 26 Feb 2007 09:09:25 -0800 (PST) Received: by 10.114.169.12 with HTTP; Mon, 26 Feb 2007 09:09:24 -0800 (PST) Message-ID: Date: Mon, 26 Feb 2007 12:09:24 -0500 From: "=?ISO-8859-1?Q?Rodrigo_De_Le=F3n?=" To: pgsql-sql@postgresql.org Subject: Re: Change Default Database In-Reply-To: <008401c759c6$81bef2c0$b364a8c0@theport.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <008401c759c6$81bef2c0$b364a8c0@theport.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/267 X-Sequence-Number: 27601 On 2/26/07, Rommel the iCeMAn wrote: > Hi list, > > I wrote a database creation script that begins with commands to drop the > existing database (if it exists) and create it from scratch. These commands > execute fine, the problem is that all subsequent commands are executed on > the default database 'postgres'. What command can I use to set the default > database to my newly created database (for the duration of the script)? SQL > Server has a 'USE [dbname]' command, is there an equivalent command in > PostgreSQL? > > Thanks in advance, > > Rommel Edwards > Software Developer, > Barbados, Caribbean. If using psql: \c dbname then the rest of the commands.