Configuration parameter

remove_temp_files_after_crash — PostgreSQL configuration parameter

Category Developer Options Change scope Sighup

When set to on, which is the default, PostgreSQL will automatically remove temporary files after a backend crash.

At a glance

Property Value
Parameter remove_temp_files_after_crash
Category Developer Options
Default (see documentation)
Value type boolean (on/off)
Change scope Reload (postgresql.conf, SIGHUP)
Available in PostgreSQL 14, 15, 16, 17, 18, 19 (added in 14)

What it does

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.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Set it in postgresql.conf (or with ALTER SYSTEM) and reload with SELECT pg_reload_conf(); or pg_ctl reload — no restart needed.

Inspect the current value and source with SHOW remove_temp_files_after_crash; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'remove_temp_files_after_crash';.

Tuning guidance

This is a developer and debugging aid, not a performance knob. Leave it at the default in production; enable it only temporarily, on a non-production or carefully controlled system, while diagnosing a specific problem. Several options in this group add overhead, generate large volumes of log output, or can damage data if misused — turn them off again as soon as the investigation is done.

Reference

PostgreSQL documentation — remove_temp_files_after_crash.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters