Re: Executing script file

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Tumurbaatar S(dot)" <tumurbaatar(at)datacom(dot)mn>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Executing script file
Date: 2004-04-13 08:37:01
Message-ID: 200404130937.01646.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michal Hlavac 2004-04-13 08:44:30 Filesystem vs. Postgres for images
Previous Message Chris 2004-04-13 08:02:00 Re: Executing script file