Re: move from 1 database to another

From: Ragnar <gnari(at)hive(dot)is>
To: "P(dot)M" <pmdanger(at)yahoo(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: move from 1 database to another
Date: 2006-05-25 22:54:36
Message-ID: 1148597676.8566.17.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On fim, 2006-05-25 at 11:52 -0700, P.M wrote:

> I would like to know how can i move from 1 database to another one ?
>
> basically i want to run a *.sql script in which i connect under a
> particular database (for example : template1 or postgres) and my *.sql
> script should create a new database (for example : test) and after
> execute several SQL command under test database.

I guess you are asking how to connect to a new database
in the middleof a sql script

Assuming the script will be run by psql, you can use
\connect test

gnari

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Reyes 2006-05-25 23:16:03 Status of gist locking in 8.1.3?
Previous Message Michael Fuhr 2006-05-25 22:50:53 Re: move from 1 database to another