Re: Allowing parallel pg_restore from pipe - Mailing list pgsql-hackers

From Timothy Garnett
Subject Re: Allowing parallel pg_restore from pipe
Date
Msg-id CAPcyiQ0GZMgFJvbXG=DCVktj=MgcdDNSFoLMxNuRyYOa6S6e1g@mail.gmail.com
Whole thread Raw
In response to Re: Allowing parallel pg_restore from pipe  (Shaun Thomas <sthomas@optionshouse.com>)
List pgsql-hackers
> If you need something like this short term, we actually found a way to do it
> ourselves for a migration we performed back in October. The secret is xargs
> with the -P option:
>
> xargs -I{} -P 8 -a table-list.txt \
>     bash -c "pg_dump -Fc -t {} my_db | pg_restore -h remote -d my_db"
>
> Fill table-list.txt with as many, or as few tables as you want. The above
> example would give you 8 parallel threads. Well equipped systems may be able
> to increase this.
>
> Admittedly it's a gross hack, but it works. :)

I think you'd have to be real careful around foreign key constraints
for that to work.

Tim



pgsql-hackers by date:

Previous
From: Shaun Thomas
Date:
Subject: Re: Allowing parallel pg_restore from pipe
Next
From: David Powers
Date:
Subject: Re: streaming replication, "frozen snapshot backup on it" and missing relfile (postgres 9.2.3 on xfs + LVM)