Description:
PostgreSQL can create a temporary file for actions such as sorting, hashing and temporary query results when these operations exceed 'work_mem'. The 'log_temp_files' flag controls logging names and the file size when it is deleted.
Configuring 'log_temp_files' to '0' causes all temporary file information to be logged, while positive values log only files whose size is greater than or equal to the specified number of kilobytes. A value of '-1' disables temporary file information logging.
Rationale:
If all temporary files are not logged, it may be more difficult to identify potential performance issues that may be due to either poor application coding or deliberate resource starvation attempts.
From Console:
From Command Line:
gcloud sql instances list
gcloud sql instances patch INSTANCE_NAME --database-flags log_temp_files='0'
Note: This command will overwrite all database flags previously set. To keep those and add new ones, include the values for all flags to be set on the instance; any flag not specifically included is set to its default value. For flags that do not take a value, specify the flag name followed by an equals sign ("=").
.