Re: Executing script file - Mailing list pgsql-general

From Richard Huxton
Subject Re: Executing script file
Date
Msg-id 200404130937.01646.dev@archonet.com
Whole thread Raw
In response to Executing script file  ("Tumurbaatar S." <tumurbaatar@datacom.mn>)
List pgsql-general
On Tuesday 13 April 2004 08:40, Tumurbaatar S. wrote:
> Hi!
> I cannot imagine how to create db from a script file and execute
> other DDL statements on this new db.

> P.S. Some RDBMS automatically switches to a newly created db
> after 'CREATE DATABASE' and some other languages have command
> like 'USE' to switch to a different db.

You want to look into the "\c" command available in psql. That reconnects to a
different db / user.

Worth doing a pg_dump (text format) and looking at its output (or pg_restore
to a text-file).

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: Chris
Date:
Subject: Re: Executing script file
Next
From: Michal Hlavac
Date:
Subject: Filesystem vs. Postgres for images