CertGrid CertGrid
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

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.

Every command on this page ran on db-a01.
Server NameIP AddressOSRolesCPURAMHDD
db-a01192.168.0.81Ubuntu 26.04 LTSPrimary / Source / Replica Set Member 12 Core4 GB50 GB

This guide includes

Use this when a setting has to outlive the session that set it. This matters because SET lasts one connection while ALTER SYSTEM writes a file the server owns - and it is SQL, so it needs no shell access to the host at all.

Before you start

  1. Change a setting for one session only

  2. Make a change the server records for you

Official sources