Skip to main content

create_data_dir_secure

Function create_data_dir_secure 

Source
pub fn create_data_dir_secure(data_dir: &Path) -> Result<()>
Expand description

Create a database data directory with owner-only permissions.

On Unix the directory is created (and, if it already exists, tightened) to 0700 so that the heap files, WAL, and indexes it contains — which hold all row data — are not world- or group-readable under a typical umask. This is the same posture PostgreSQL enforces on its data directory: locking the directory down protects every file inside it regardless of each file’s own mode. On non-Unix platforms this is a plain recursive create.