Question

I have a rather large Insert Query, and upon running this my slow disks fill up towards 100% upon where I revive:

Transaction aborted because DBD::Pg::db do failed: ERROR:  could not write to hash-join temporary file: No space left on device

Sounds believable, I have a Fast drive with lots of space on it that i could use instead of the slow disk but I dont want to make the fast disk the default table-space or move the table im inserting into to the fast disk, I just want that data-blob that is generated as part of the insert query to be on the fast disk table-space. Is this possible is PostgreSQL and if so how?

version 9.1

Was it helpful?

Solution

You want the temp_tablespaces configuration directive. See the docs.

Temporary files for purposes such as sorting large data sets are also created in these tablespaces

You must CREATE TABLESPACE the tablespace(s) before using them in an interactive SET temp_tablespaces command.

SET LOCAL temp_tablespaces may be used to set it only for the current transaction.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top