postgresql.auto.conf

A configuration file located in the data directory which stores configuration settings generated via PostgreSQL

postgresql.auto.conf is a configuration file with the same format as postgresql.conf, but which is located in the data directory and is managed by PostgreSQL itself (via the ALTER SYSTEM command) or client applications (e.g. pg_basebackup in PostgreSQL 12 and later). Normally it should not be edited manually.

postgresql.auto.conf is always evaluated last, so configuration settings stored here will always override settings in other files.

postgresql.auto.conf was added in PostgreSQL 9.4.

Source code

The filename is defined in src/include/utils/guc.h as:

#define PG_AUTOCONF_FILENAME      "postgresql.auto.conf"

Functions related to modifying postgresql.auto.conf are located in src/backend/utils/misc/guc.c, in particular:

  • AlterSystemSetConfigFile() - the underlying function for ALTER SYSTEM
  • replace_auto_config_value()
  • write_auto_conf_file()

postgresql.auto.conf is processed in src/backend/utils/misc/guc.c, function ProcessConfigFileInternal().

Change history

Categories

Configuration

See also

ALTER SYSTEM, postgresql.conf, pg_settings, pg_file_settings