{"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"}],"derived_content_hash":"231c3486f21d6831a50bf7fe6d4c28aca4fd8b460254ca3f8c50d28748e05236","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:a0050485e4de3366bad84a501250972f75086f50831534bcc46cd2988772f6af","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"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"],"repair_provenance":{"original_source_revision":"english-manuals:09a3a8010911cfd475ee39781e726ac63315d671f259b0d3fbdd776cafdc169c","receipt_sha256":"1b22aaf4930ff6a53769ea077102ca548cb21adc538c7736de615d67747b8644","repair":"wiki-repair-20261023"},"short_desc":"This parameter contains a comma-separated list of C function names.","short_desc_zh":"","source_rev":"wiki-repair-20261023:a0050485e4de3366bad84a501250972f75086f50831534bcc46cd2988772f6af","unit":"","vartype":"string"}},"Definition":{"Collection":"guc","Key":"backtrace_functions","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"backtrace_functions","SourceRevision":"wiki-repair-20261023:a0050485e4de3366bad84a501250972f75086f50831534bcc46cd2988772f6af","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.","description_zh":"这个参数包含一个以逗号分隔的 C 函数名称列表。如果出现错误，并且发生错误的内部 C 函数的名称与列表中的值相匹配，那么将向服务器日志中写入一个回溯跟踪信息和错误消息。这可以用来调试源代码的特定区域。 回溯支持并非在所有平台上都可以使用，并且回溯的质量取决于编译选项。 只有超级用户和具有适当 SET 权限的用户才能更改此设置。","description_zh_html":"\u003cp\u003e\n        这个参数包含一个以逗号分隔的 C 函数名称列表。如果出现错误，并且发生错误的内部 C 函数的名称与列表中的值相匹配，那么将向服务器日志中写入一个回溯跟踪信息和错误消息。这可以用来调试源代码的特定区域。\n       \u003c/p\u003e\u003cp\u003e\n        回溯支持并非在所有平台上都可以使用，并且回溯的质量取决于编译选项。\n       \u003c/p\u003e\u003cp\u003e\n        只有超级用户和具有适当 \u003ccode class=\"literal\"\u003eSET\u003c/code\u003e 权限的用户才能更改此设置。\n       \u003c/p\u003e","doc":{"anchor":"GUC-BACKTRACE-FUNCTIONS","file":"runtime-config-developer.html","lang":"en","sha256":"a3f6a107ed6ba4edaf6df03e52f4a469bd09350d545e4ff419e62844025ec1cf","slug":"18"},"doc_html":"\u003cp\u003e\n        This parameter contains a comma-separated list of C function names.\n        If an error is raised and the name of the internal C function where\n        the error happens matches a value in the list, then a backtrace is\n        written to the server log together with the error message.  This can\n        be used to debug specific areas of the source code.\n       \u003c/p\u003e\u003cp\u003e\n        Backtrace support is not available on all platforms, and the quality\n        of the backtraces depends on compilation options.\n       \u003c/p\u003e\u003cp\u003e\n        Only superusers and users with the appropriate \u003ccode class=\"literal\"\u003eSET\u003c/code\u003e\n        privilege can change this setting.\n       \u003c/p\u003e","doc_same_as":"","documentation_revision":{"inputs":[{"file":"runtime-config-developer.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"a3f6a107ed6ba4edaf6df03e52f4a469bd09350d545e4ff419e62844025ec1cf","version":"18.7"},{"file":"runtime-config-developer.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"e7e22aa5738a1d376b84af1adca796c5e14746266733f925eb50c3ef86a50655","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"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","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-developer.html","sha256":"3c08bf624188bbb0733dc7854e61c0c251c2578311ac3dc8fa626ab21b7911d1"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"string","zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"GUC-BACKTRACE-FUNCTIONS","file":"runtime-config-developer.html","lang":"en","sha256":"a3f6a107ed6ba4edaf6df03e52f4a469bd09350d545e4ff419e62844025ec1cf","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\u003e\n        This parameter contains a comma-separated list of C function names.\n        If an error is raised and the name of the internal C function where\n        the error happens matches a value in the list, then a backtrace is\n        written to the server log together with the error message.  This can\n        be used to debug specific areas of the source code.\n       \u003c/p\u003e\u003cp\u003e\n        Backtrace support is not available on all platforms, and the quality\n        of the backtraces depends on compilation options.\n       \u003c/p\u003e\u003cp\u003e\n        Only superusers and users with the appropriate \u003ccode\u003eSET\u003c/code\u003e\n        privilege can change this setting.\n       \u003c/p\u003e","SourceRevision":"wiki-repair-20261023:a0050485e4de3366bad84a501250972f75086f50831534bcc46cd2988772f6af","ContentHash":"91fdb5cd01c0131b9ef155caa29f2ec771edaafd61fa5c224733f4421eea6cbb","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":"en","Fallback":false,"Versions":["13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
