{"Entry":{"collection":"guc","key":"backtrace_functions","name":"backtrace_functions","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Developer Options","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"12","status":"added","to":"13"},{"documentation_changed":true,"fields":{},"from":"14","status":"changed","to":"15"}],"content_hash":"28a4c13a4d5f96076d174ad8cc94990eb5e69f85381bce3c2d11a9dca7aba5e7","context":"","default_changed_in":[],"default_history":[{"from":"13","to":"19","value":"Empty string"}],"editorial":{"advice":{"olap":"Long analytical runs can amplify backtrace_functions'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 backtrace_functions. 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 backtrace_functions at its upstream default. A small host has less spare CPU, disk, connection, and log capacity for developer instrumentation."},"mechanism":["backtrace_functions is a comma-separated list of internal C function names. If an error originates in a listed function, PostgreSQL appends a native backtrace to that error in the server log.","It matches C symbols, not SQL function names. Availability and symbol quality depend on platform, compiler, build flags, debug information, and whether functions were inlined.","The setting can target a narrow failure path without logging stacks for every error. Stack traces can expose implementation detail and increase log volume, so collection should be scoped and protected. Its superuser context permits an authorized session change without a server restart."],"pitfalls":["Leaving backtrace_functions 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: backtrace_functions","url":"https://www.postgresql.org/docs/19/runtime-config-developer.html#GUC-BACKTRACE-FUNCTIONS"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["log_error_verbosity","log_min_error_statement","compute_query_id","log_line_prefix"],"summary":"backtrace_functions — Log backtrace for errors in these functions. Observed in PG13–19 Beta 4; its last measured boot default is empty string in PG19 Beta 4, with superuser context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"13","group":"Developer Options","group_slug":"developer","imported_at":"2026-09-27T17:57:30.865302+08:00","intro_commit":{"authored_at":"2019-11-08T15:44:20-03:00","discussion":["https://postgr.es/m//5f48cb47-bf1e-05b6-7aae-3bf2cd01586d@2ndquadrant.com","https://postgr.es/m/CAMsr+YGL+yfWE=JvbUbnpWtrRZNey7hJ07+zT4bYJdVp4Szdrg@mail.gmail.com"],"hash":"71a8a4f6e36547bb060dbcc961ea9b57420f7190","subject":"Add backtrace support for error reporting","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=71a8a4f6e36547bb060dbcc961ea9b57420f7190"},"key":"backtrace_functions","last_version":"20","max_val":"","min_val":"","name":"backtrace_functions","position":40,"present_in":["13","14","15","16","17","18","19","20"],"short_desc":"This parameter contains a comma-separated list of C function names.","short_desc_zh":"","source_rev":"english-manuals:09a3a8010911cfd475ee39781e726ac63315d671f259b0d3fbdd776cafdc169c","unit":"","vartype":"string"}},"Definition":{"Collection":"guc","Key":"backtrace_functions","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"backtrace_functions","SourceRevision":"english-manuals:09a3a8010911cfd475ee39781e726ac63315d671f259b0d3fbdd776cafdc169c","Facts":{"boot_val":"","category":"Developer Options","context":"superuser","description":"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. Only superusers and users with the appropriate SET privilege can change this setting.","doc":{"anchor":"GUC-BACKTRACE-FUNCTIONS","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":"backtrace_functions","short_desc":"Log backtrace for errors in these functions.","source":"pg-settings-source-snapshot","unit":null,"vartype":"string"},"ManualEvidence":{"doc":{"anchor":"GUC-BACKTRACE-FUNCTIONS","file":"runtime-config-developer.html","lang":"en","sha256":"f5e7e39d176c642ac0799c87669ce2f6f60fcd97d109e290860ec74c36d7ecad","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"backtrace_functions","SourceDatabase":"center","Version":"18","Locale":"en","Title":"backtrace_functions","Summary":"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. Only superusers and users with the appropriate SET privilege can change this setting.","BodyHTML":"\u003cp\u003eThis 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. Only superusers and users with the appropriate SET privilege can change this setting.\u003c/p\u003e","SourceRevision":"english-manuals:09a3a8010911cfd475ee39781e726ac63315d671f259b0d3fbdd776cafdc169c","ContentHash":"c2ba268433d04accf826f95e4564faf4207654cad7bc8404996adece1fefe94c","Payload":{"description":"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. Only superusers and users with the appropriate SET privilege can change this setting."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
