From: Rodrigo De León <rdeleonp@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Change Default Database
Date: Mon, 26 Feb 2007 12:09:24 -0500
Message-ID: <a55915760702260909r361c0274pa6faf2dee70f44ba@mail.gmail.com> (raw)
In-Reply-To: <008401c759c6$81bef2c0$b364a8c0@theport.com>
References: <008401c759c6$81bef2c0$b364a8c0@theport.com>
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.
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: rdeleonp@gmail.com
Subject: Re: Change Default Database
In-Reply-To: <a55915760702260909r361c0274pa6faf2dee70f44ba@mail.gmail.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