Re: Executing script file

From: Chris <list(at)1006(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Executing script file
Date: 2004-04-13 08:02:00
Message-ID: 1081843320.5047.15.camel@dell
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> Currently I use 'psql -f file' to perform all needed DDL statements
> except of create db. Because when I insert 'CREATE DATABASE'
> at the beginning of the script, the server creates a db but following
> commands like 'CREATE TABLE' and etc run on the current db, i.e.
> not in context of newly created db. Any ideas?

Use \c, like this:

\c your_new_database

Bye, Chris.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-04-13 08:37:01 Re: Executing script file
Previous Message Tumurbaatar S. 2004-04-13 07:40:30 Executing script file