Need some help on PG database transfer - Mailing list pgsql-general

From Steeles
Subject Need some help on PG database transfer
Date
Msg-id AANLkTikxZyS3EgfMi203Y_BVaTgaGkccYiOBWiUFcZlY@mail.gmail.com
Whole thread Raw
Responses Re: Need some help on PG database transfer  (Scott Marlowe <scott.marlowe@gmail.com>)
List 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.

pgsql-general by date:

Previous
From: Piotr Gasidło
Date:
Subject: Re: Difference between EXPLAIN ANALYZE SELECT ... total runtime and SELECT ... runtime
Next
From: Scott Marlowe
Date:
Subject: Re: Need some help on PG database transfer