Re: Dump a database excluding one table DATA?

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: Dump a database excluding one table DATA?
Дата
Msg-id m2sjoxw121.fsf@2ndQuadrant.fr
обсуждение исходный текст
Ответ на Dump a database excluding one table DATA?  (Dmitry Koterov <dmitry@koterov.ru>)
Список pgsql-general
Dmitry Koterov <dmitry@koterov.ru> writes:
> Is there any way (or hack) to dump the whole database, but to exclude the
> DATA from a table within this dump? (DDL of the table should not be
> excluded: after restoring the data the excluded table should look "empty".)

The pg_staging tool allows you to do that quite easily, once you've done
the initial setup (involved, but nothing fancy).

  https://github.com/dimitri/pg_staging
  http://tapoueh.org/pgsql/pgstaging.html

If you want to exclude the table from the dumps though (data loss issues
are looking at you), what I would advice is create a dedicated schema
and skipping the whole schema at dump time, using the following option:

    --exclude-schema=schema
        Do   not  dump   any   schemas   matching  the   schema
        pattern. The  pattern is  interpreted according  to the
        same rules as  for -n.  -N can be given  more than once
        to exclude schemas matching any of several patterns.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support

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

Предыдущее
От: Edoardo Panfili
Дата:
Сообщение: Re: A questions on planner choices
Следующее
От: "TJ O'Donnell"
Дата:
Сообщение: array_agg problem