When allow_alter_system is set to off, an error is returned if the ALTER SYSTEM command is executed.
At a glance
| Property | Value |
|---|---|
| Parameter | allow_alter_system |
| Category | Version and Platform Compatibility |
| Default | on |
| Value type | boolean (on/off) |
| Change scope | Reload (postgresql.conf, SIGHUP) |
| Available in | PostgreSQL 17, 18, 19 (added in 17) |
What it does
When allow_alter_system is set to off, an error is returned if the ALTER SYSTEM command is executed. This parameter can only be set in the postgresql.conf file or on the server command line. The default value is on.
Note that this setting must not be regarded as a security feature. It only disables the ALTER SYSTEM command. It does not prevent a superuser from changing the configuration using other SQL commands. A superuser has many ways of executing shell commands at the operating system level, and can therefore modify postgresql.auto.conf regardless of the value of this setting.
(Description quoted from the official PostgreSQL documentation.)
How to apply a change
Set it in postgresql.conf (or with ALTER SYSTEM) and reload with SELECT pg_reload_conf(); or pg_ctl reload — no restart needed.
Inspect the current value and source with SHOW allow_alter_system; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'allow_alter_system';.
Tuning guidance
This controls backward-compatibility behaviour, not performance. Keep it at the modern default unless a specific legacy application depends on the older behaviour; turning compatibility flags on to paper over application bugs stores up problems for a future upgrade. Treat any non-default value as technical debt to remove.