diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-17 14:19:31 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-17 14:19:31 -0400 |
commit | 23e5b16c71f2706978c5f54aabd28ed23a54b6a5 (patch) | |
tree | 08a53d309e4839fe01b6bc07ae27ec18f1ce7f6d /src/backend/utils/misc/guc.c | |
parent | 1bc16a946008a7cbb33a9a06a7c6765a807d7f59 (diff) |
Add temp_file_limit GUC parameter to constrain temporary file space usage.
The limit is enforced against the total amount of temp file space used by
each session.
Mark Kirkwood, reviewed by Cédric Villemain and Tatsuo Ishii
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r-- | src/backend/utils/misc/guc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 72e93107910..3b33549a571 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -425,6 +425,8 @@ int log_min_duration_statement = -1; int log_temp_files = -1; int trace_recovery_messages = LOG; +int temp_file_limit = -1; + int num_temp_buffers = 1024; char *data_directory; @@ -535,6 +537,8 @@ const char *const config_group_names[] = gettext_noop("Resource Usage"), /* RESOURCES_MEM */ gettext_noop("Resource Usage / Memory"), + /* RESOURCES_DISK */ + gettext_noop("Resource Usage / Disk"), /* RESOURCES_KERNEL */ gettext_noop("Resource Usage / Kernel Resources"), /* RESOURCES_VACUUM_DELAY */ @@ -1694,6 +1698,17 @@ static struct config_int ConfigureNamesInt[] = }, { + {"temp_file_limit", PGC_SUSET, RESOURCES_DISK, + gettext_noop("Limits the total size of all temp files used by each session."), + gettext_noop("-1 means no limit."), + GUC_UNIT_KB + }, + &temp_file_limit, + -1, -1, INT_MAX, + NULL, NULL, NULL + }, + + { {"vacuum_cost_page_hit", PGC_USERSET, RESOURCES_VACUUM_DELAY, gettext_noop("Vacuum cost for a page found in the buffer cache."), NULL |