Problem description
When I run a query on my ApsaraDB RDS for PostgreSQL instance, the following error message is displayed:
ERROR: temporary file size exceeds temp_file_limit (1024kB)
Causes
A large temporary file may be generated during a query. The size of the temporary file is larger than the value of the temp_file_limit
parameter that is specified for your RDS instance. As a result, the query is interrupted.
For more information about the temp_file_limit
parameter, see temp_file_limit (integer).
Solutions
Increase the value of the temp_file_limit
parameter.
You can use one of the following methods to modify the parameter:
Global modification
Log on to the ApsaraDB RDS console and modify the parameter. For more information, see Modify the parameters of an ApsaraDB RDS for PostgreSQL instance.
NoteThe default value of the
temp_file_limit
parameter for an RDS instance is the memory capacity of the RDS instance. You can obtain the value by using the following calculation:{DBInstanceClassMemory/1024}
.Session-specific modification
Log on to your RDS instance and run the following command to modify the parameter:
SET temp_file_limit ='1GB';
Usage notes
If the temp_file_limit
parameter is set to -1
, the size of the temporary file is unlimited. We recommend that you do not set the parameter to -1
or set the parameter to a large value to prevent the disk space from being exhausted during complex queries.