snippetsqlMinor
How to change temporary directory for pg_dump?
Viewed 0 times
directorypg_dumptemporaryforhowchange
Problem
I'm running out of space from my hard drive which has a 18GB PostgreSQL database.
When I try
I tried this from Stackoverflow and a small file is created in the new directory, but nothing else, and
How do I change temp directory for
Note: My
My db version is 9.0.13.
When I try
pg_dump to a different drive, PostgreSQL creates temporary files on the disk it's dumping from, so I run out of space and the dump fails.I tried this from Stackoverflow and a small file is created in the new directory, but nothing else, and
pg_dump still writes to the original disk.How do I change temp directory for
pg_dump?Note: My
work_mem setting is pretty high already, I can't change that.My db version is 9.0.13.
Solution
The temporary files are a side effect of the
A backup in default plain format goes through without temporary tables in the local drive. Omit the option to produce a backup in plain format without temporary local files.
--format=tar option.A backup in default plain format goes through without temporary tables in the local drive. Omit the option to produce a backup in plain format without temporary local files.
Context
StackExchange Database Administrators Q#52378, answer score: 6
Revisions (0)
No revisions yet.