Parameter · Version and Platform Compatibility / Other Platforms and Clients
allow_alter_system
Allows running the ALTER SYSTEM command. Can be set to off for environments where global configuration changes should be made using a different method.
- Default:
on - Type: bool
- Applies: Reload
In plain words
ALTER SYSTEM lets a superuser change server settings from SQL; they are saved in postgresql.auto.conf. When configuration is managed by tools like Ansible, Patroni or Kubernetes operators, such changes would silently override the managed files. Setting allow_alter_system = off (PostgreSQL 17+) makes ALTER SYSTEM fail instead.
For DBAs and operators
With off:
ERROR: ALTER SYSTEM is not allowed in this environment
It is not a security boundary: a superuser can still change settings in many other ways (writing files with COPY … TO, extensions, SET per session …). It only prevents accidental drift from the managed configuration. It can only be set in postgresql.conf or on the command line, not via ALTER SYSTEM itself.
When debugging "my postgresql.conf change has no effect", check postgresql.auto.conf, which is read last and wins:
SELECT name, setting, sourcefile FROM pg_settings
WHERE sourcefile LIKE '%postgresql.auto.conf';How to change it
Change in postgresql.conf or ALTER SYSTEM, then run SELECT pg_reload_conf().