Re: Specify tables to be backed up

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Specify tables to be backed up
Дата
Msg-id 25528.1221488041@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Specify tables to be backed up  ("Rob Richardson" <Rob.Richardson@rad-con.com>)
Список pgsql-novice
"Rob Richardson" <Rob.Richardson@rad-con.com> writes:
> I'm thinking the only way of doing what I
> want to do is to have a batch file that contains a string of pg_dump
> calls, something along the lines of:

> pg_dump -t table1 MyDatabase > mydump.backup
> pg_dump -t table2 MyDatabase >> mydump.backup
> pg_dump -t -s big_table_I_only_want_the_schema_of MyDatabase >>
> mydump.backup

> Will that work?  Is there a better way?

Recent versions of pg_dump have switches to exclude specific tables.
Consider
    pg_dump --exclude-table=big_table ...
    pg_dump -s -t big_table ...

            regards, tom lane

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

Предыдущее
От: "Rob Richardson"
Дата:
Сообщение: Specify tables to be backed up
Следующее
От: "Wright, George"
Дата:
Сообщение: cpu utilization question