Specifies the main server configuration file (customarily called postgresql.conf).
At a glance
| Property | Value |
|---|---|
| Parameter | config_file |
| Category | File Locations |
| Default | (see documentation) |
| Value type | string |
| Change scope | Per-session (SET) |
| Available in | PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12) |
What it does
Specifies the main server configuration file (customarily called postgresql.conf). This parameter can only be set on the postgres command line.
(Description quoted from the official PostgreSQL documentation.)
How to apply a change
Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.
Inspect the current value and source with SHOW config_file; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'config_file';.
Tuning guidance
This is a deployment path, not something you tune for performance. Set it once to match how the cluster is laid out on disk (or leave it at the packaged default), keep it consistent across restarts and replicas, and change it only when deliberately relocating files. A wrong path prevents the server from starting.