{"Entry":{"collection":"guc","key":"debug_assertions","name":"debug_assertions","aliases":[],"metadata":{"baseline":true,"boot_human":"Not specified","boot_val":null,"category":"Preset Options","category_zh":"","changed_in":["9.5"],"changes":[{"documentation_changed":true,"fields":{},"from":"7.4","status":"changed","to":"8.0"},{"documentation_changed":true,"fields":{},"from":"8.1","status":"changed","to":"8.2"},{"documentation_changed":true,"fields":{"category":{"from":"Developer Options","to":"Preset Options"},"context":{"from":"user","to":"internal"},"extra_desc":{"from":"This is a debugging aid.","to":null},"short_desc":{"from":"Turns on various assertion checks.","to":"Shows whether the running server has assertion checks enabled."}},"from":"9.4","status":"changed","to":"9.5"}],"content_hash":"cde4cf961a82ca21fd043879808d07a206366357ccea15e9766b05309f276d45","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"off"}],"derived_content_hash":"6c28c9faed8ae9c9af2224c4597ef09a620b2731aea0813ba790ee5583b2de38","editorial":{"advice":{"olap":"Not tunable. Use debug_assertions to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible.","oltp":"Not tunable. Record debug_assertions as a deployment/capability fact; if it is unexpected, fix the binary, initdb, or database-creation process rather than trying SET.","small":"Not tunable. Preserve it in inventory and incident reports; do not custom-build or rebuild merely to change it without a demonstrated compatibility need."},"mechanism":["Shows whether the running server has assertion checks enabled. It is read-only and cannot be changed with SET or configuration-file edits.","It reflects whether the server binary was built with assertion checks, a developer diagnostic that adds overhead and may abort on violated invariants.","Interpret it with server_version, server_version_num, server_encoding. Applications and operations tooling may read debug_assertions for capability or environment detection, but cannot SET it; cross-cluster comparisons must account for build, initdb, and current-database differences."],"pitfalls":["Trying to change read-only debug_assertions with SET or a configuration file.","Assuming every cluster, database, or vendor build reports the same value.","Ignoring the value in file-format or feature-compatibility checks.","Treating reported metadata as a performance target instead of an environment fact."],"references":[{"title":"PostgreSQL 19 Beta 4: debug_assertions","url":"https://www.postgresql.org/docs/19/runtime-config-preset.html#GUC-DEBUG-ASSERTIONS"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["server_version","server_version_num","server_encoding","ssl_library","integer_datetimes","block_size"],"summary":"debug_assertions — Shows whether the running server has assertion checks enabled. Observed in PG9.0–19 Beta 4; its last measured boot default is off in PG19 Beta 4, with internal context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"7.4","group":"Preset Options","group_slug":"preset","imported_at":"2026-09-27T17:57:31.032162+08:00","intro_commit":{},"key":"debug_assertions","last_version":"20","max_val":"","min_val":"","name":"debug_assertions","position":82,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:c3e901aebc7f12f05f9f90033c3300510008392a889b01bc48080470eeca8eb3","receipt_sha256":"ba454d5b3d6b99b08b4059ddf040048a05d00b754a7a6865bb342fd22ef33858","repair":"wiki-repair-20261023"},"short_desc":"Reports whether PostgreSQL has been built with assertions enabled.","short_desc_zh":"","source_rev":"wiki-repair-20261023:b301cd9d49071e989a4daa786ac5c7f438760b010b738cab7756d6514a771246","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"debug_assertions","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"debug_assertions","SourceRevision":"wiki-repair-20261023:b301cd9d49071e989a4daa786ac5c7f438760b010b738cab7756d6514a771246","Facts":{"boot_val":"off","category":"Preset Options","context":"internal","description":"Reports whether PostgreSQL has been built with assertions enabled. That is the case if the macro USE_ASSERT_CHECKING is defined when PostgreSQL is built (accomplished e.g., by the configure option --enable-cassert). By default PostgreSQL is built without assertions.","description_zh":"报告 PostgreSQL 是否在构建时启用了断言。如果在构建 PostgreSQL 时定义了宏 USE_ASSERT_CHECKING（例如通过 configure 选项 --enable-cassert），则会报告已启用。默认情况下，PostgreSQL 是在未启用断言的情况下构建的。","description_zh_html":"\u003cp\u003e\n        报告 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 是否在构建时启用了断言。如果在构建 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 时定义了宏\n        \u003ccode class=\"symbol\"\u003eUSE_ASSERT_CHECKING\u003c/code\u003e（例如通过\n        \u003ccode class=\"command\"\u003econfigure\u003c/code\u003e 选项 \u003ccode class=\"option\"\u003e--enable-cassert\u003c/code\u003e），则会报告已启用。默认情况下，\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 是在未启用断言的情况下构建的。\n       \u003c/p\u003e","doc":{"anchor":"GUC-DEBUG-ASSERTIONS","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"debug_assertions","short_desc":"Shows whether the running server has assertion checks enabled.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-preset.html","sha256":"d0e95b9a81d5fdf853df26eba7dc096d96b9b45dadda13e0d0353aa72ac7a7b9"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"bool","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-DEBUG-ASSERTIONS","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"debug_assertions","SourceDatabase":"center","Version":"18","Locale":"en","Title":"debug_assertions","Summary":"Reports whether PostgreSQL has been built with assertions enabled. That is the case if the macro USE_ASSERT_CHECKING is defined when PostgreSQL is built (accomplished e.g., by the configure option --enable-cassert). By default PostgreSQL is built without assertions.","BodyHTML":"\u003cp\u003eReports whether PostgreSQL has been built with assertions enabled. That is the case if the macro USE_ASSERT_CHECKING is defined when PostgreSQL is built (accomplished e.g., by the configure option --enable-cassert). By default PostgreSQL is built without assertions.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:b301cd9d49071e989a4daa786ac5c7f438760b010b738cab7756d6514a771246","ContentHash":"f1bea5ae9ebd9e2f1e66af9cb5fd39f4402be099a9cd0b8b1175c50e54179c4f","Payload":{"description":"Reports whether PostgreSQL has been built with assertions enabled. That is the case if the macro USE_ASSERT_CHECKING is defined when PostgreSQL is built (accomplished e.g., by the configure option --enable-cassert). By default PostgreSQL is built without assertions."}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
