pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <smarlowe@g2switchworks.com>
To: Rommel the iCeMAn <icecrew@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Change Default Database
Date: Mon, 26 Feb 2007 13:40:42 -0600
Message-ID: <1172518842.20651.19.camel@state.g2switchworks.com> (raw)
In-Reply-To: <008401c759c6$81bef2c0$b364a8c0@theport.com>
References: <008401c759c6$81bef2c0$b364a8c0@theport.com>

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.



view thread (10+ messages)  latest in thread

Message-ID: <1172518842.20651.19.camel@state.g2switchworks.com>
Permalink:  ../1172518842.20651.19.camel@state.g2switchworks.com/
Also on:    postgresql.org/message-id/1172518842.20651.19.camel@state.g2switchworks.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: smarlowe@g2switchworks.com, icecrew@gmail.com
  Subject: Re: Change Default Database
  In-Reply-To: <1172518842.20651.19.camel@state.g2switchworks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox