Configuration parameter

hosts_file — PostgreSQL configuration parameter

Category File Locations Change scope Postmaster

Specifies the configuration file for host-based SSL configuration (customarily called pg_hosts.conf).

At a glance

Property Value
Parameter hosts_file
Category File Locations
Default (see documentation)
Value type string
Change scope Server restart required (postgresql.conf)
Available in PostgreSQL 19 (added in 19)

What it does

Specifies the configuration file for host-based SSL configuration (customarily called pg_hosts.conf). This parameter can only be set at server start. See also ssl_sni.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Set it in postgresql.conf (or with ALTER SYSTEM) and restart the server — this parameter cannot change without a restart.

Inspect the current value and source with SHOW hosts_file; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'hosts_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.

Reference

PostgreSQL documentation — hosts_file.

Keep going

Related & next steps

Concepts on this page

Was this helpful?

← All configuration parameters