如何更改 pg_dump 的临时目录?

kis*_*rgy 7 postgresql dump

I'm running out of space from my hard drive which has a 18GB PostgreSQL database.
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.

Erw*_*ter 6

临时文件是--format=tar选项的副作用。

默认普通格式的备份在本地驱动器中没有临时表的情况下进行。省略在没有临时本地文件的情况下以纯格式生成备份的选项。