Re: [GENERAL] Copy database to another host without data fromspecific tables

Поиск
Список
Период
Сортировка
От Vick Khera
Тема Re: [GENERAL] Copy database to another host without data fromspecific tables
Дата
Msg-id CALd+dcewa8HSGdBJvjvm5-337_+FDgwZD-xDXPFrt2GxV9pbAQ@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] Copy database to another host without data from specific tables  (Panagiotis Atmatzidis <atma@convalesco.org>)
Ответы Re: [GENERAL] Copy database to another host without data from specific tables
Список pgsql-general

On Tue, Mar 7, 2017 at 2:02 AM, Panagiotis Atmatzidis <atma@convalesco.org> wrote:
I want to make a clone of database1 which belongs to user1, to database2 which belongs to user2. Database1 has 20+ tables. I want to avoid copying the DATA sitting on 5 tables on database1 (many Gigs).

I've read one too many posts about how to perform the actions with "pg_dump" and "pg_restore" but I'm trying to figure out the easiest way to do this. The process I have in mind is this:


Your method will break down if you have FKs and you're not careful with the order you copy your data.

pg_dump has an --exclude-table flag which I would suggest. Just apply it multiple times to exclude your 5 tables.

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

Предыдущее
От: Johann Spies
Дата:
Сообщение: Re: [GENERAL] is (not) distinct from
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: [GENERAL] intentional or oversight? pg_dump -c does not restoredefault priviliges on schema public