Re: Change Default Database

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Rommel the iCeMAn <icecrew(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Change Default Database
Date: 2007-02-26 19:40:42
Message-ID: 1172518842.20651.19.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, 2007-02-26 at 10:52, 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?

A couple of points:

1: PLEASE don't post html email, especially with an annoying background
that makes it harder to read your message.

2: What kind of script is this? sql? bash? PHP? perl?

If you post the script, we can probably help you out a bit.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Marlowe 2007-02-26 21:39:23 Re: Change Default Database
Previous Message Rodrigo De León 2007-02-26 18:43:00 Re: Change Default Database