Re: Moving Tablespaces

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Moving Tablespaces
Дата
Msg-id 19923.1136322815@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Moving Tablespaces  (Allen Fair <dba@girders.org>)
Ответы Re: Moving Tablespaces  (Allen Fair <dba@girders.org>)
Re: Moving Tablespaces  (Allen Fair <allen@cyberdesk.com>)
Список pgsql-general
Allen Fair <dba@girders.org> writes:
> Looking at the "create tablespace " command in the docs, I was wondering
> how easy it is to move a database/tablespace to another server/instance
> of PostgreSQL.

It's not.  The contents of the tablespace are tied to the instance
(because rows contain transaction numbers that won't match up with
another instance).  Also, a tablespace by itself is just a useless
pile of bits; you can't access it unless there are system catalog
entries for the tables, and there's no way to export selected catalog
entries into another instance.

It's possible to get around the transaction-numbering problem by
doing VACUUM FREEZE before you copy the table files, but I don't
see any very workable solution to the catalog-entries problem.
You could possibly copy an entire database including its catalogs
after freezing the whole thing ... but the tablespace feature
certainly does not make that any easier.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Allen Fair
Дата:
Сообщение: Moving Tablespaces
Следующее
От: Emi Lu
Дата:
Сообщение: When it is better to use "timestamp without time zone"?