{"Entry":{"collection":"guc","key":"data_directory_mode","name":"data_directory_mode","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Preset Options","category_zh":"","changed_in":["14"],"changes":[{"documentation_changed":false,"fields":{},"from":"10","status":"added","to":"11"},{"documentation_changed":true,"fields":{"short_desc":{"from":"Mode of the data directory.","to":"Shows the mode of the data directory."}},"from":"13","status":"changed","to":"14"},{"documentation_changed":true,"fields":{},"from":"17","status":"changed","to":"18"}],"content_hash":"28ee9abb4b2caceaeb9aee85efdca628cfce583687dbd3aedb46398f369eccc6","context":"","default_changed_in":[],"default_history":[{"from":"11","to":"19","value":"448"}],"editorial":{"advice":{"olap":"Not tunable. Use data_directory_mode to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible.","oltp":"Not tunable. Record data_directory_mode 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 the mode of the data directory. It is read-only and cannot be changed with SET or configuration-file edits.","It reports the effective Unix permission mode of the data directory, commonly 0700 or group-readable 0750, in decimal pg_settings representation.","Interpret it with block_size, data_checksums, debug_assertions. Applications and operations tooling may read data_directory_mode 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 data_directory_mode 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: data_directory_mode","url":"https://www.postgresql.org/docs/19/runtime-config-preset.html#GUC-DATA-DIRECTORY-MODE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["block_size","data_checksums","debug_assertions","huge_pages_status","in_hot_standby","integer_datetimes"],"summary":"data_directory_mode shows the mode of the data directory. It is read-only metadata in PG11–18, not a runtime tuning control."},"enumvals":[],"first_version":"11","group":"Preset Options","group_slug":"preset","imported_at":"2026-09-27T17:57:31.014492+08:00","intro_commit":{"authored_at":"2018-04-07T17:45:39-04:00","discussion":["https://postgr.es/m/ad346fe6-b23e-59f1-ecb7-0e08390ad629%40pgmasters.net"],"hash":"c37b3d08ca6873f9d4eaf24c72a90a550970cbb8","subject":"Allow group access on PGDATA","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c37b3d08ca6873f9d4eaf24c72a90a550970cbb8"},"key":"data_directory_mode","last_version":"20","max_val":"","min_val":"","name":"data_directory_mode","position":78,"present_in":["11","12","13","14","15","16","17","18","19","20"],"short_desc":"On Unix systems this parameter reports the permissions the data directory (defined by data_directory) had at server startup.","short_desc_zh":"","source_rev":"english-manuals:40e01f8cb7037af282e0b5bd43439751c87ddb082e440ee1cc8c92eb6a104d99","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"data_directory_mode","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"data_directory_mode","SourceRevision":"english-manuals:40e01f8cb7037af282e0b5bd43439751c87ddb082e440ee1cc8c92eb6a104d99","Facts":{"boot_val":"448","category":"Preset Options","context":"internal","description":"On Unix systems this parameter reports the permissions the data directory (defined by data_directory) had at server startup. (On Microsoft Windows this parameter will always display 0700.) See the initdb -g option for more information.","doc":{"anchor":"GUC-DATA-DIRECTORY-MODE","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"The parameter value is a numeric mode specification in the form accepted by the chmod and umask system calls. (To use the customary octal format the number must start with a 0 (zero).)","lang":"en","max_val":"511","metadata_version":"18","min_val":"0","name":"data_directory_mode","short_desc":"Shows the mode of the data directory.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-DATA-DIRECTORY-MODE","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"data_directory_mode","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"data_directory_mode","Summary":"","BodyHTML":"\u003cp\u003e在 Unix 系统上，这个参数报告服务器启动时数据目录（由\u003ca href=\"/docs/18/runtime-config-file-locations.html#GUC-DATA-DIRECTORY\" rel=\"nofollow\"\u003edata_directory\u003c/a\u003e定义）的权限。（在Microsoft Windows上这个参数将总是显示\u003ccode\u003e0700\u003c/code\u003e。）更多信息请参考\u003ca href=\"/docs/18/app-initdb.html#APP-INITDB-ALLOW-GROUP-ACCESS\" rel=\"nofollow\"\u003e\u003cspan\u003einitdb\u003c/span\u003e 的 \u003ccode\u003e-g\u003c/code\u003e 选项\u003c/a\u003e。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"9e68f4db35434ca0e7353344c351e9ffec4d49995a55b7443711e8ef8d508973","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e在 Unix 系统上，这个参数报告服务器启动时数据目录（由\u003ca href=\"/docs/18/runtime-config-file-locations.html#GUC-DATA-DIRECTORY\"\u003edata_directory\u003c/a\u003e定义）的权限。（在Microsoft Windows上这个参数将总是显示\u003ccode class=\"literal\"\u003e0700\u003c/code\u003e。）更多信息请参考\u003ca href=\"/docs/18/app-initdb.html#APP-INITDB-ALLOW-GROUP-ACCESS\"\u003e\u003cspan class=\"application\"\u003einitdb\u003c/span\u003e 的 \u003ccode class=\"option\"\u003e-g\u003c/code\u003e 选项\u003c/a\u003e。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
