{"Entry":{"collection":"guc","key":"remove_temp_files_after_crash","name":"remove_temp_files_after_crash","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Developer Options","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"13","status":"added","to":"14"}],"content_hash":"e58790260290a45ea4a7b7f5cfbe62096f40dfe6f980c6b22fc11cbf12a5fdbe","context":"","default_changed_in":[],"default_history":[{"from":"14","to":"19","value":"on"}],"editorial":{"advice":{"olap":"Long analytical runs can amplify remove_temp_files_after_crash's debug overhead and artifacts. Prefer standard EXPLAIN and statistics first, and isolate any developer experiment from normal users.","oltp":"Do not tune production OLTP with remove_temp_files_after_crash. Enable it only for a bounded reproduction with an owner, log/disk budget, rollback condition, and evidence-capture plan; restore the default immediately afterward.","small":"Keep remove_temp_files_after_crash at its upstream default. A small host has less spare CPU, disk, connection, and log capacity for developer instrumentation."},"mechanism":["After a backend crash, remove_temp_files_after_crash controls whether PostgreSQL removes temporary files left by the failed process. on is the normal cleanup behavior.","Turning it off preserves artifacts for forensic debugging but repeated failures can accumulate useless files and exhaust the temporary-file file systems.","The setting does not prevent a crash, recover query state, or retain ordinary temporary tables for reuse. Any forensic retention needs explicit space monitoring and later cleanup. Its SIGHUP context allows configuration reload without a server restart."],"pitfalls":["Leaving remove_temp_files_after_crash enabled after the bounded diagnostic or recovery task.","Running the experiment on the only copy of production data.","Underestimating log, core-file, temporary-file, WAL, CPU, or connection-slot amplification.","Treating a server that merely starts or completes a query as proof that data and behavior are correct."],"references":[{"title":"PostgreSQL 19 Beta 4: remove_temp_files_after_crash","url":"https://www.postgresql.org/docs/19/runtime-config-developer.html#GUC-REMOVE-TEMP-FILES-AFTER-CRASH"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["temp_file_limit","temp_tablespaces","log_temp_files","send_abort_for_crash"],"summary":"remove_temp_files_after_crash — Remove temporary files after backend crash. Observed in PG14–19 Beta 4; its last measured boot default is on in PG19 Beta 4, with sighup context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"14","group":"Developer Options","group_slug":"developer","imported_at":"2026-09-27T17:57:31.899786+08:00","intro_commit":{"authored_at":"2021-03-18T16:05:03+01:00","discussion":["https://postgr.es/m/CAH503wDKdYzyq7U-QJqGn%3DGm6XmoK%2B6_6xTJ-Yn5WSvoHLY1Ww%40mail.gmail.com"],"hash":"cd91de0d17952b5763466cfa663e98318f26d357","subject":"Remove temporary files after backend crash","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=cd91de0d17952b5763466cfa663e98318f26d357"},"key":"remove_temp_files_after_crash","last_version":"20","max_val":"","min_val":"","name":"remove_temp_files_after_crash","position":336,"present_in":["14","15","16","17","18","19","20"],"short_desc":"When set to on, which is the default, PostgreSQL will automatically remove temporary files after a backend crash.","short_desc_zh":"","source_rev":"english-manuals:4c2723aff02021a8a0dd527ccf75b9a7f31f8743ec0aec7c1bcf28479f874b7e","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"remove_temp_files_after_crash","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"remove_temp_files_after_crash","SourceRevision":"english-manuals:4c2723aff02021a8a0dd527ccf75b9a7f31f8743ec0aec7c1bcf28479f874b7e","Facts":{"boot_val":"on","category":"Developer Options","context":"sighup","description":"When set to on, which is the default, PostgreSQL will automatically remove temporary files after a backend crash. If disabled, the files will be retained and may be used for debugging, for example. Repeated crashes may however result in accumulation of useless files. This parameter can only be set in the postgresql.conf file or on the server command line.","doc":{"anchor":"GUC-REMOVE-TEMP-FILES-AFTER-CRASH","file":"runtime-config-developer.html","lang":"en","sha256":"f5e7e39d176c642ac0799c87669ce2f6f60fcd97d109e290860ec74c36d7ecad","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"remove_temp_files_after_crash","short_desc":"Remove temporary files after backend crash.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-REMOVE-TEMP-FILES-AFTER-CRASH","file":"runtime-config-developer.html","lang":"en","sha256":"f5e7e39d176c642ac0799c87669ce2f6f60fcd97d109e290860ec74c36d7ecad","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"remove_temp_files_after_crash","SourceDatabase":"center","Version":"18","Locale":"en","Title":"remove_temp_files_after_crash","Summary":"When set to on, which is the default, PostgreSQL will automatically remove temporary files after a backend crash. If disabled, the files will be retained and may be used for debugging, for example. Repeated crashes may however result in accumulation of useless files. This parameter can only be set in the postgresql.conf file or on the server command line.","BodyHTML":"\u003cp\u003eWhen set to on, which is the default, PostgreSQL will automatically remove temporary files after a backend crash. If disabled, the files will be retained and may be used for debugging, for example. Repeated crashes may however result in accumulation of useless files. This parameter can only be set in the postgresql.conf file or on the server command line.\u003c/p\u003e","SourceRevision":"english-manuals:4c2723aff02021a8a0dd527ccf75b9a7f31f8743ec0aec7c1bcf28479f874b7e","ContentHash":"5e3bad815f6c31ea8eeec01e0283443a0d9b7df0dfb6cd42699fe9f7e9f9a311","Payload":{"description":"When set to on, which is the default, PostgreSQL will automatically remove temporary files after a backend crash. If disabled, the files will be retained and may be used for debugging, for example. Repeated crashes may however result in accumulation of useless files. This parameter can only be set in the postgresql.conf file or on the server command line."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
