View Single Post

   
  #1 (permalink)  
Old 04-19-2008, 04:09 PM
=?ISO-8859-1?Q?Rodrigo_De_Le=F3n?=
 
Posts: n/a
Default Re: Change Default Database

On 2/26/07, Rommel the iCeMAn <icecrew@gmail.com> 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.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply With Quote