Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
ALTER SYSTEM(7) 	  PostgreSQL 18.6 Documentation 	 ALTER SYSTEM(7)

NAME
     ALTER_SYSTEM - change a server configuration parameter

SYNOPSIS
     ALTER SYSTEM SET configuration_parameter { TO | = } { value [, ...] | DEFAULT }

     ALTER SYSTEM RESET configuration_parameter
     ALTER SYSTEM RESET ALL

DESCRIPTION
     ALTER  SYSTEM  is	used for changing server configuration parameters across
     the entire database cluster. It can be more convenient than the traditional
     method of manually editing the postgresql.conf file.  ALTER  SYSTEM  writes
     the given parameter setting to the postgresql.auto.conf file, which is read
     in  addition  to  postgresql.conf. Setting a parameter to DEFAULT, or using
     the  RESET  variant,  removes  that  configuration  entry	from  the  post-
     gresql.auto.conf  file.  Use RESET ALL to remove all such configuration en-
     tries.

     Values set with ALTER SYSTEM will be effective after the next  server  con-
     figuration  reload, or after the next server restart in the case of parame-
     ters that can only be changed at server start. A server  configuration  re-
     load can be commanded by calling the SQL function pg_reload_conf(), running
     pg_ctl reload, or sending a SIGHUP signal to the main server process.

     Only superusers and users granted ALTER SYSTEM privilege on a parameter can
     change it using ALTER SYSTEM. Also, since this command acts directly on the
     file  system and cannot be rolled back, it is not allowed inside a transac-
     tion block or function.

PARAMETERS
     configuration_parameter
	 Name of a settable configuration parameter.  Available  parameters  are
	 documented in Chapter 19.

     value
	 New  value  of  the  parameter.  Values can be specified as string con-
	 stants, identifiers, numbers, or comma-separated lists of these, as ap-
	 propriate for the particular parameter. Values that are neither numbers
	 nor valid identifiers must be quoted.	DEFAULT can be written to  spec-
	 ify removing the parameter and its value from postgresql.auto.conf.

	 For  some  list-accepting  parameters,  quoted values will produce dou-
	 ble-quoted output to preserve whitespace and commas; for  others,  dou-
	 ble-quotes  must  be  used inside single-quoted strings to get this ef-
	 fect.

NOTES
     This command can't be used to set data_directory,	allow_alter_system,  nor
     parameters that are not allowed in postgresql.conf (e.g., preset options).

     See Section 19.1 for other ways to set the parameters.

     ALTER SYSTEM can be disabled by setting allow_alter_system to off, but this
     is  not  a  security mechanism (as explained in detail in the documentation
     for this parameter).

EXAMPLES
     Set the wal_level:

	 ALTER SYSTEM SET wal_level = replica;

     Undo that, restoring whatever setting was effective in postgresql.conf:

	 ALTER SYSTEM RESET wal_level;

COMPATIBILITY
     The ALTER SYSTEM statement is a PostgreSQL extension.

SEE ALSO
     SET(7), SHOW(7)

PostgreSQL 18.6 		      2026			 ALTER SYSTEM(7)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=ALTER_SYSTEM&sektion=7&manpath=FreeBSD+Ports+15.1.quarterly>

home | help