Configuration·PostgreSQL
PostgreSQL ALTER SYSTEM and postgresql.auto.conf
`SET` lasts one session, `ALTER SYSTEM` writes a file the server owns. Between them they cover every durable change without ever editing a config file by hand.
Configuration Guide 13 of 47 Intermediate
- OSUbuntu 26.04 LTS (resolute)
- PostgreSQL18.6-0ubuntu0.26.04.1
- PackagingDebian cluster layout
- TimeAbout 14 min
- Reviewed27 August 2026
Written against the versions above. `postgresql.auto.conf` is read last, so it overrides every other file. That makes it powerful and makes it the first place to look when a config file appears to be ignored.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| db-a01 | 192.168.0.81 | Ubuntu 26.04 LTS | Primary / Source / Replica Set Member 1 | 2 Core | 4 GB | 50 GB |
Before you start
- A superuser connection -
sudo -u postgres psql.
-
Change a setting for one session only
-
Make a change the server records for you