Copying database directory

From: "Tsing, Vadim" <Vadim(dot)Tsing(at)snapon(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Copying database directory
Date: 2010-12-16 19:18:49
Message-ID: 035B18EFA3CCA540AF17AD5D3DFD9847E097F0@LISL-XBCK-C1-V2.snaponglobal.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

We are trying to select a database engine for a new product we plan to
start developing. One of the requirements is to be able to ship the data
on the media and install it on the user's hard-drive.

One of the issues we've run into is that pg_restore takes a lot of time
to restore large database.

Also, moving entire data directory is not an option since we will have
multiple databases that user can choose to install.

We've tried to copy the database directory and it seems to work.
Unfortunately we are not sure if there is any, not visible, damage to
the data.

So, here is my question: Is it possible to:

1. Create a database

2. Stop postgres

3. Empty out the directory created by the new database

4. Copy files from another database (created on a different
server) into that directory

5. Start postgres and use the database

Once this is completed we may need to repeat the process for another
database.

Is this possible? If not, what are other options?

Any help or suggestions is greatly appreciated.

Thank you.

Browse pgsql-admin by date

  From Date Subject
Next Message Anibal David Acosta 2010-12-16 19:18:50 using limit
Previous Message Frederiko Costa 2010-12-16 07:57:04 Re: restore database files