Need some help on PG database transfer

From: Steeles <steeles(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Need some help on PG database transfer
Date: 2010-07-22 20:08:06
Message-ID: AANLkTikxZyS3EgfMi203Y_BVaTgaGkccYiOBWiUFcZlY@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I am doing some tests on the file level copying for one of database in
windows platform. Here is what I want to achieve.

copy files within PG tablespace folder where PG database resides to target
machine. I want to attache the copied data to target PG database.

What I have done is

1. Database: ABCD, OID: 12345, tablespace: e:\pg_data\, obviously,
e:\pg_data has a subfolder named 12345.
2. create database in target, named 2222, and it will create its own OID,
for example, 16333, the folder 16333 will reside under BASE folder.
3. then I stop PG service, delete all files under ..\16333\*.*,
4. copy all files from e:\pg_data\12345\*.* to the folder in target server,
..\16333\.
5. start PG service in target machine. it looks like it pickup most of
tables that are from its source database, ABCD.

But, It is missing tables and functions, compared to sources.

Is it doable for replicating data like that?

PG tablespace, does it contain all the data/tables in its table space
folder?

Please comment.

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2010-07-22 20:13:01 Re: Need some help on PG database transfer
Previous Message Piotr Gasidło 2010-07-22 19:46:15 Re: Difference between EXPLAIN ANALYZE SELECT ... total runtime and SELECT ... runtime