ALTER SYSTEM

An SQL command for modifying the PostgreSQL configuration

ALTER SYSTEM is a utility command for modifying the PostgreSQL configuration.

ALTER SYSTEM was added in PostgreSQL 9.4.

Caveats

ALTER SYSTEM can only be executed by a superuser. It is not possible to grant a non-superuser privileges to execute ALTER SYSTEM; however, from PostgreSQL 15 permission to alter individual configuration parameters can be granted to non-superusers.

It is not possible to wrap the command in a transaction or security definer function.

If ALTER SYSTEM is used to set the value of a configuration parameter to 'DEFAULT' (for example log_error_verbosity), the value must be enclosed in single quotes, otherwise ALTER SYSTEM will interpret it as ALTER SYSTEM SET ... TO DEFAULT, which removes the configuration parameter from postgresql.auto.conf entirely.

Source code

ALTER SYSTEM is handled by the function AlterSystemSetConfigFile() in src/backend/utils/misc/guc.c.

Change history

Categories

Configuration, SQL command, Utility command

See also

postgresql.conf, postgresql.auto.conf, pg_reload_conf()