This parameter contains a comma-separated list of C function names.
At a glance
| Property | Value |
|---|---|
| Parameter | backtrace_functions |
| Category | Developer Options |
| Default | (see documentation) |
| Value type | string |
| Change scope | Per-session (SET) |
| Available in | PostgreSQL 13, 14, 15, 16, 17, 18, 19 (added in 13) |
What it does
This parameter contains a comma-separated list of C function names. If an error is raised and the name of the internal C function where the error happens matches a value in the list, then a backtrace is written to the server log together with the error message. This can be used to debug specific areas of the source code.
Backtrace support is not available on all platforms, and the quality of the backtraces depends on compilation options.
(Description quoted from the official PostgreSQL documentation.)
How to apply a change
Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.
Inspect the current value and source with SHOW backtrace_functions; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'backtrace_functions';.
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.