# data_directory_mode

> data_directory_mode shows the mode of the data directory. It is read-only metadata in PG11–18, not a runtime tuning control.
---

> [!NOTE]
> **Fact — official short description:** “Shows the mode of the data directory.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `integer` | Upstream pg_settings type |
| Context | `internal` | Internal/preset and not user-settable |
| Unit | — | Raw unit |
| Range | `0` – `511` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Preset Options | Upstream classification |
| Latest boot value | `448` | 448 |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG11 |
| Present in | PG11–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`c37b3d08ca68`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c37b3d08ca6873f9d4eaf24c72a90a550970cbb8) — Allow group access on PGDATA |
| Commit date | 2018-04-07 |
| Discussion | [thread 1](https://postgr.es/m/ad346fe6-b23e-59f1-ecb7-0e08390ad629%40pgmasters.net) |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG11–19 Beta 3 | `448` | — | 448 |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#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.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| 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. |
| OLAP | Not tunable. Use data_directory_mode to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible. |
| Small nodes | Not tunable. Preserve it in inventory and incident reports; do not custom-build or rebuild merely to change it without a demonstrated compatibility need. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG11–19 Beta 3 unmodified; OLAP: PG11–19 Beta 3 unmodified; CRIT: PG11–19 Beta 3 unmodified; TINY: PG11–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-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.

## Related parameters {#related-parameters}

[`block_size`](/parameters/block-size/) · [`data_checksums`](/parameters/data-checksums/) · [`debug_assertions`](/parameters/debug-assertions/) · [`huge_pages_status`](/parameters/huge-pages-status/) · [`in_hot_standby`](/parameters/in-hot-standby/) · [`integer_datetimes`](/parameters/integer-datetimes/)

## References {#references}

- [PostgreSQL 19 Beta 3 — data_directory_mode](https://www.postgresql.org/docs/19/runtime-config-preset.html#GUC-DATA-DIRECTORY-MODE)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
