Re: pg_dump & table space

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump & table space
Дата
Msg-id 16944.1243866423@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_dump & table space  (Luca Ferrari <fluca1978@infinito.it>)
Ответы Re: pg_dump & table space  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
Luca Ferrari <fluca1978@infinito.it> writes:
> is there a way to dump an entire database which has a specific table space
> without having in the sql file any reference to the tablespace? This can be
> useful when moving the database from one machine to another (that does not use
> the tablespace). Any way to achieve that with pg_dump?

Recent versions have

  --no-tablespaces            do not dump tablespace assignments

However, this is really just cosmetic, as the dump is set up like this:

SET default_tablespace = whatever;
CREATE TABLE whichever(...);

If tablespace 'whatever' doesn't exist, you'll get an error on the SET
but the CREATE will succeed anyway.  (I guess this only works cleanly
if the destination machine has *none* of the source's tablespaces,
else things might get assigned to unexpected tablespaces.  But it's
definitely possible to restore a dump without having the same
tablespaces.)

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Foreign key verification trigger conditions
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: ruby connect