Re: Excluding tables from pg_restore

Поиск
Список
Период
Сортировка
От Nigel J. Andrews
Тема Re: Excluding tables from pg_restore
Дата
Msg-id Pine.LNX.4.21.0306161753160.3121-100000@ponder.fairway2k.co.uk
обсуждение исходный текст
Ответ на Excluding tables from pg_restore  (Carlos <Carlos@pbsinet.com>)
Список pgsql-general
On Mon, 16 Jun 2003, Carlos wrote:

> Hi forum,
>
> How can I exclude a few tables from a pg_dump and a pg_restore?  I have a
> pg_dump of a database with several hundred tables and I want to restore most
> of these tables into another database hence I want to exclude a couple of
> the tables from the restore.  In the man pages, I found the -t option for
> pg_restore but I would have to name several hundreds tables to use this.
>
> Thanks in advance for your response
>

Well, you could write a little wrapper script that took a list of tables to
exclude, listed the tables in an archive, filtered out the ones given to your
wrapper script and  ran pg_restore with what was left.

Of course you'll have to take care not to exceed command line lengths which
means you'd have to be prepared for multiple invocations of pg_restore to load
all the table, or use a langauge you can exec pg_restore directly.


--
Nigel J. Andrews


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

Предыдущее
От: MT
Дата:
Сообщение: Best pg_dump practices
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: RE : full featured alter table?