Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Change Default Database



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.



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group