Home Explore Blog CI



postgresql

1st chunk of `doc/src/sgml/ref/alter_system.sgml`
ef6d35ddaaecb08618e9b1d07ffd5ddabe3fce8a30ed5e930000000100000a16
<!--
doc/src/sgml/ref/alter_system.sgml
PostgreSQL documentation
-->

<refentry id="sql-altersystem">
 <indexterm zone="sql-altersystem">
  <primary>ALTER SYSTEM</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>ALTER SYSTEM</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>ALTER SYSTEM</refname>
  <refpurpose>change a server configuration parameter</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
ALTER SYSTEM SET <replaceable class="parameter">configuration_parameter</replaceable> { TO | = } { <replaceable class="parameter">value</replaceable> [, ...] | DEFAULT }

ALTER SYSTEM RESET <replaceable class="parameter">configuration_parameter</replaceable>
ALTER SYSTEM RESET ALL
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>ALTER SYSTEM</command> 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 <filename>postgresql.conf</filename> file.
   <command>ALTER SYSTEM</command> writes the given parameter setting to
   the <filename>postgresql.auto.conf</filename> file, which is read in
   addition to <filename>postgresql.conf</filename>.
   Setting a parameter to <literal>DEFAULT</literal>, or using the
   <command>RESET</command> variant, removes that configuration entry from the
   <filename>postgresql.auto.conf</filename> file. Use <literal>RESET
   ALL</literal> to remove all such configuration entries.
  </para>

  <para>
   Values set with <command>ALTER SYSTEM</command> will be effective after
   the next server configuration reload, or after the next server restart
   in the case of parameters that can only be changed at server start.
   A server configuration reload can be commanded by calling the SQL
   function <function>pg_reload_conf()</function>, running <literal>pg_ctl reload</literal>,
   or sending a <systemitem>SIGHUP</systemitem> signal to the main server process.
  </para>

  <para>
   Only superusers and users granted <literal>ALTER SYSTEM</literal> privilege
   on a parameter can change it using <command>ALTER SYSTEM</command>.  Also, since
   this command acts directly on the file system and cannot be rolled back,
   it is not allowed inside a transaction block or function.
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><replaceable class="parameter">configuration_parameter</replaceable></term>

Title: ALTER SYSTEM: Change Server Configuration Parameter
Summary
The ALTER SYSTEM command allows administrators to change server configuration parameters cluster-wide, offering a convenient alternative to directly editing postgresql.conf. It modifies the postgresql.auto.conf file, which is read in addition to postgresql.conf. Changes take effect after a server configuration reload or restart. Only superusers or users with ALTER SYSTEM privilege can use this command, and it cannot be used within a transaction block or function.