Parameter · Preset Options
data_directory_mode
Shows the mode of the data directory. 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).)
- Default:
448 - Type: integer
- Range: 0 … 511
- Applies: Read-only
In plain words
Shows the Unix permissions of the data directory. By default only the postgres OS user may read it (0700). Clusters created with group access (0750) let members of the group read files, for example a backup user.
For DBAs and operators
Determined at server start from the permissions of $PGDATA and shown in octal: 0750 if the directory has group read/execute, otherwise 0700. Group access was added in PostgreSQL 11 (initdb --allow-group-access / -g, or chmod -R g+rX on a stopped cluster). New files are created with matching permissions. If the directory is group-writable or has any permission for others, the server refuses to start: FATAL: data directory "/var/lib/postgresql/18/main" has invalid permissions with DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750). A common support ticket after restoring a backup or copying a data directory with the wrong user or umask.
How to change it
Fixed when PostgreSQL was built or the cluster was initialised. You can only read it.