Re: Copy Database Structure
От | Christopher A. Goodfellow |
---|---|
Тема | Re: Copy Database Structure |
Дата | |
Msg-id | 000f01c1c146$20e2f1e0$2284de3f@tealuxe.com обсуждение исходный текст |
Ответ на | Re: Copy Database Structure (Jeff Self <jself@nngov.com>) |
Список | 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 по дате отправления: