views:

96

answers:

2

Hi,

While restoring some database backups I noticed that pg_dump is actually using INSERTS rather than COPY. I am not even specifying -d flag but it's still using INSERTS for every database / table I try to dump which is why restores take hours rather than minutes.

According to the pg docs pg_dump should use COPY by default but in my case it's not. Is there a way to ensure pg_dump uses COPY ?

Here's the pg_dump command:

pg_dump -Fp -t some_table -h localhost -d thisDB -f /some_dir/bkup

Any ideas ?

Thx.

+1  A: 

In the command line you posted, you are in fact specifying the -d flag, although it seems that you try to use it to specify the database to use. Try the following instead:

pg_dump -Fp -t some_table -h localhost -f /some_dir/bkup thisDB
Pär Wieslander
+2  A: 

you are specifying -d !!!!!:

pg_dump -Fp -t some_table -h localhost -d thisDB -f /some_dir/bkup
                                      ^^^^

Luckily -d is no more.

depesz
Hi you're correct I was confusing -d for the database. Thanks for pointing that out.
Ad