Need some help on PG database transfer

Поиск
Список
Период
Сортировка
От Steeles
Тема Need some help on PG database transfer
Дата
Msg-id AANLkTikxZyS3EgfMi203Y_BVaTgaGkccYiOBWiUFcZlY@mail.gmail.com
обсуждение исходный текст
Ответы Re: Need some help on PG database transfer  (Scott Marlowe <scott.marlowe@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Piotr Gasidło
Дата:
Сообщение: Re: Difference between EXPLAIN ANALYZE SELECT ... total runtime and SELECT ... runtime
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Need some help on PG database transfer