ALTER SYSTEM <refpurpose>change a server configuration parameter</refpurpose> — サーバの設定パラメータを変更する
ALTER SYSTEM SETconfiguration_parameter{ TO | = } {value[, ...] | DEFAULT } ALTER SYSTEM RESETconfiguration_parameterALTER SYSTEM RESET ALL
   <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.
ALTER SYSTEMはデータベースクラスタ全体にわたるサーバの設定パラメータを変更するのに使われます。
手作業でpostgresql.confファイルを編集するという伝統的な方法よりも、この方が便利かもしれません。
ALTER SYSTEMは指定されたパラメータ設定をpostgresql.auto.confファイルに書き出し、これがpostgresql.confに加えて読み込まれます。
パラメータをDEFAULTに設定する、あるいはこれの別表記であるRESETを使うと、postgresql.auto.confファイルから、その設定のエントリを削除します。
そのような設定のエントリをすべて削除するにはRESET ALLを使用してください。
  
   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.
ALTER SYSTEMで設定された値は、次回のサーバ設定の再ロードで、またサーバ開始時にのみ変更可能なパラメータについては次回のサーバ再起動で有効になります。
サーバ設定の再ロードは、SQL関数pg_reload_conf()の呼び出し、pg_ctl reloadの実行、あるいはメインのサーバプロセスにSIGHUPを送信することで実行できます。
  
   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.
スーパーユーザとパラメータに関するALTER SYSTEM権限を付与されたユーザだけが、ALTER SYSTEMを使ってパラメータを変更できます。
また、このコマンドはファイルシステムに直接作用し、ロールバックできないため、トランザクションブロックや関数の内部で使うことはできません。
  
configuration_parameterName of a settable configuration parameter. Available parameters are documented in <xref linkend="runtime-config"/>. 設定する設定パラメータの名前です。 利用可能なパラメータに付いては第19章に記述されています。
value
      New value of the parameter.  Values can be specified as string
      constants, identifiers, numbers, or comma-separated lists of
      these, as appropriate for the particular parameter.
      Values that are neither numbers nor valid identifiers must be quoted.
      <literal>DEFAULT</literal> can be written to specify removing the
      parameter and its value from <filename>postgresql.auto.conf</filename>.
パラメータの新しい値です。
値は、対象のパラメータとして適切な文字列定数、識別子、数値あるいはそれらをカンマで区切ったリストで指定できます。
数字でも有効な識別子でもない値は、引用符で囲む必要があります。
DEFAULTと指定することができ、このとき、パラメータとその値をpostgresql.auto.confから削除します。
     
For some list-accepting parameters, quoted values will produce double-quoted output to preserve whitespace and commas; for others, double-quotes must be used inside single-quoted strings to get this effect. リストを受け付ける一部のパラメータでは、引用符付きの値は、空白とカンマが保持されるように二重引用符で囲まれた出力になります。 その他のパラメータでは、この効果を得るために、単一引用符で囲まれた文字列内で二重引用符を使用する必要があります。
   This command can't be used to set <xref linkend="guc-data-directory"/>,
   <xref linkend="guc-allow-alter-system"/>,
   nor parameters that are not allowed in <filename>postgresql.conf</filename>
   (e.g., <link linkend="runtime-config-preset">preset options</link>).
このコマンドは、data_directory、allow_alter_systemを設定するのに使うことはできませんし、postgresql.confで設定できないパラメータ(例えば設定済みのオプション)を設定するのに使うこともできません。
  
See <xref linkend="config-setting"/> for other ways to set the parameters. パラメータを設定するその他の方法については19.1を参照してください。
   <literal>ALTER SYSTEM</literal> can be disabled by setting
   <xref linkend="guc-allow-alter-system"/> to <literal>off</literal>, but this
   is not a security mechanism (as explained in detail in the documentation for
   this parameter).
ALTER SYSTEMはallow_alter_systemをoffに設定することで無効にできますが、(そのパラメータのドキュメントで詳細に説明されているように)これはセキュリティ機構ではありません。
  
   Set the <literal>wal_level</literal>:
wal_levelを設定します。
ALTER SYSTEM SET wal_level = replica;
   Undo that, restoring whatever setting was effective
   in <filename>postgresql.conf</filename>:
それを取り消して、postgresql.confで有効だった設定に戻します。
ALTER SYSTEM RESET wal_level;
   The <command>ALTER SYSTEM</command> statement is a
   <productname>PostgreSQL</productname> extension.
ALTER SYSTEM文はPostgreSQLの拡張です。