{"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"}],"derived_content_hash":"1e9a477fa32e334179f14cefd39cb04301ea5eaf032650648175a4444f907488","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"],"repair_provenance":{"original_source_revision":"english-manuals:40e01f8cb7037af282e0b5bd43439751c87ddb082e440ee1cc8c92eb6a104d99","receipt_sha256":"c66c780753dda64848fbf45274c681fa18476d8fa499df0877a3ffb8137c80ca","repair":"wiki-repair-20261023"},"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":"wiki-repair-20261023:aafdcbaefa273ced7e2e024c5e257c06514d2a9084ad3d8c9a6a3289e7799031","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"data_directory_mode","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"data_directory_mode","SourceRevision":"wiki-repair-20261023:aafdcbaefa273ced7e2e024c5e257c06514d2a9084ad3d8c9a6a3289e7799031","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.","description_zh":"在 Unix 系统上，这个参数报告服务器启动时数据目录（由 data_directory 定义）的权限。（在 Microsoft Windows 上这个参数将总是显示 0700。）更多信息请参考 initdb 的 -g 选项。","description_zh_html":"\u003cp\u003e\n        在 Unix 系统上，这个参数报告服务器启动时数据目录（由 \u003ca class=\"xref\" href=\"/zh/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 class=\"link\" href=\"/zh/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。\n       \u003c/p\u003e","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","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":"integer","zh_from":"same-version-pgdoc"},"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":"center","Version":"18","Locale":"en","Title":"data_directory_mode","Summary":"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.","BodyHTML":"\u003cp\u003eOn 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.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:aafdcbaefa273ced7e2e024c5e257c06514d2a9084ad3d8c9a6a3289e7799031","ContentHash":"f540b96ee5a2d92ad5663b27a137a6cc169b0e6d72b9b09a77d25e06217ed33d","Payload":{"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."}},"RequestedLocale":"en","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}
