Creating a table in a different database

From: "Simon Dale" <sdale(at)rm(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Creating a table in a different database
Date: 2006-06-06 07:27:02
Message-ID: 416F947BF5BA9E40B5F9AA649422212E078BA5AE@ex-mail2.internal.rmplc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

The CREATE TABLE command creates a table in the current database. What I
want to achieve is a SQL script that will create a database and a user
and then create some tables and functions in the new database.

Is it possible to do this in a single SQL file, and if so, how do I
change the database part way through the file to create the tables in
the correct database?

Thanks,

Simon
______________________________________________________________________

You might be interested in this...

Professor Tim Brighouse describes the key features shared by successful schools in his new book - Download your copy now

http://www.rm.com/Generic.asp?cref=GP650420&Srcurl=ICS0505
______________________________________________________________________

Visit our Website at http://www.rm.com

This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information for the intended purpose only. Internet communications are not secure; therefore, RM does not accept legal responsibility for the contents of this message. Any views or opinions presented are those of the author only and not of RM. If this email has come to you in error, please delete it, along with any attachments. Please note that RM may intercept incoming and outgoing email communications.

Freedom of Information Act 2000
This email and any attachments may contain confidential information belonging to RM. Where the email and any attachments do contain information of a confidential nature, including without limitation information relating to trade secrets, special terms or prices these shall be deemed for the purpose of the Freedom of Information Act 2000 as information provided in confidence by RM and the disclosure of which would be prejudicial to RM's commercial interests.

This email has been scanned for viruses by Trend ScanMail.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Aaron Bono 2006-06-06 08:57:50 Re: Creating a table in a different database
Previous Message Tom Lane 2006-06-05 19:01:22 Re: postgres dying