Re: Copy Database Structure - Mailing list pgsql-novice

From Christopher A. Goodfellow
Subject Re: Copy Database Structure
Date
Msg-id 000f01c1c146$20e2f1e0$2284de3f@tealuxe.com
Whole thread Raw
In response to Re: Copy Database Structure  (Jeff Self <jself@nngov.com>)
List pgsql-novice
Thanks, that worked great!!!!!!



Chris Goodfellow
Director of IT
Tealuxe, Inc.
25 Kenwood Circle
Franklin, MA 02038
Voice:  (508) 520-7887 Ext:22
Fax: (508) 528-8999
HTTP://www.tealuxe.com

 -----Original Message-----
From:     pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org]  On Behalf Of Jeff Self
Sent:    Friday, March 01, 2002 11:54 AM
To:    cgoodfellow@tealuxe.com
Cc:    Pgsql-Novice (E-mail)
Subject:    Re: [NOVICE] Copy Database Structure

Try pg_dump -s dbname > outputfile
This gives you the schema of the database but without the data.

Then to reload it:
psql -e dbname < outputfile

Make sure you create the database first and have the owner set properly.
You may need to go into the outputfile and change the owner for the new
database.

On Fri, 2002-03-01 at 11:19, Christopher A. Goodfellow wrote:
> I have an existing database that I want to copy all the tables,
> relationships, and keys to another database.
> Does anyone know how to duplicate a database?
> I don't need to copy the data but I could always delete all the records
> after the copy if needed.
>
> Chris Goodfellow
> Director of IT
> Tealuxe, Inc.
> 25 Kenwood Circle
> Franklin, MA 02038
> Voice:  (508) 520-7887 Ext:22
> Fax: (508) 528-8999
> HTTP://www.tealuxe.com
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
--
Jeff Self
Information Technology Analyst
Department of Personnel
City of Newport News
2400 Washington Ave.
Newport News, VA 23607
757-926-6930


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org


pgsql-novice by date:

Previous
From: Jeff Self
Date:
Subject: Re: Copy Database Structure
Next
From: "Josh Berkus"
Date:
Subject: Re: timestamp value