Re: move from 1 database to another

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Jim Nasby <jnasby(at)pervasive(dot)com>
Cc: "P(dot)M" <pmdanger(at)yahoo(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: move from 1 database to another
Date: 2006-05-25 22:50:53
Message-ID: 20060525225053.GA73142@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 25, 2006 at 05:41:34PM -0500, Jim Nasby wrote:
> On May 25, 2006, at 1:52 PM, 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.
>
> CREATE DATABASE new_database TEMPLATE = database_to_copy;
> -- Insert additional SQL here...

I wonder if the OP is looking for "\c new_database".

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar 2006-05-25 22:54:36 Re: move from 1 database to another
Previous Message Jim Nasby 2006-05-25 22:41:34 Re: move from 1 database to another