バージョンごとのドキュメント一覧

54.24. pg_settings #

The view <structname>pg_settings</structname> provides access to run-time parameters of the server. It is essentially an alternative interface to the <link linkend="sql-show"><command>SHOW</command></link> and <link linkend="sql-set"><command>SET</command></link> commands. It also provides access to some facts about each parameter that are not directly available from <link linkend="sql-show"><command>SHOW</command></link>, such as minimum and maximum values. pg_settingsビューはサーバの実行時パラメータへのアクセスを提供します。 基本的にSHOWSETコマンドの代わりとなるインタフェースです。 同時に最大・最小値などのようにSHOWコマンドでは直接入手できないそれぞれのパラメータのいくつかの実状にアクセスする機能を提供します。

表54.24 pg_settingsの列

<title><structname>pg_settings</structname> Columns</title>

Column Type 列 型

Description 説明

name text

Run-time configuration parameter name 実行時設定パラメータ名

setting text

Current value of the parameter パラメータの現在値

unit text

Implicit unit of the parameter 暗黙的なパラメータの単位

category text

Logical group of the parameter パラメータの論理グループ

short_desc text

A brief description of the parameter パラメータの簡潔な説明

extra_desc text

Additional, more detailed, description of the parameter 追加で、より詳細なパラメータについての説明

context text

Context required to set the parameter's value (see below) パラメータ値を設定するために必要な文脈(後述)

vartype text

Parameter type (<literal>bool</literal>, <literal>enum</literal>, <literal>integer</literal>, <literal>real</literal>, or <literal>string</literal>) パラメータの型(boolenumintegerrealもしくはstring

source text

Source of the current parameter value 現在のパラメータ値のソース

min_val text

Minimum allowed value of the parameter (null for non-numeric values) 容認されている最小のパラメータ値(数値でない場合はNULL)

max_val text

Maximum allowed value of the parameter (null for non-numeric values) 容認されている最大のパラメータ値(数値でない場合はNULL)

enumvals text[]

Allowed values of an enum parameter (null for non-enum values) 許可された列挙パラメータの値(列挙型ではない場合はNULL)

boot_val text

Parameter value assumed at server startup if the parameter is not otherwise set パラメータが設定されていなかったとした場合に仮定されるサーバ起動時のパラメータ値

reset_val text

Value that <link linkend="sql-reset"><command>RESET</command></link> would reset the parameter to in the current session 現状のセッションにおいてRESETによって戻されるパラメータの値

sourcefile text

Configuration file the current value was set in (null for values set from sources other than configuration files, or when examined by a user who neither is a superuser nor has privileges of <literal>pg_read_all_settings</literal>); helpful when using <literal>include</literal> directives in configuration files 現状の値が設定されている設定ファイル(設定ファイル以外のソースから設定された値の場合、スーパーユーザでもpg_read_all_settingsの権限を持たないユーザから検査された時はNULLです)。 設定ファイル内でinclude指示子を使用する時に役に立ちます。

sourceline int4

Line number within the configuration file the current value was set at (null for values set from sources other than configuration files, or when examined by a user who neither is a superuser nor has privileges of <literal>pg_read_all_settings</literal>). 現状の値が設定されている設定ファイル内の行番号(設定ファイル以外のソースから設定された値の場合、スーパーユーザでもpg_read_all_settingsの権限を持たないユーザから検査された時はNULLです)。

pending_restart bool

<literal>true</literal> if the value has been changed in the configuration file but needs a restart; or <literal>false</literal> otherwise. trueの場合は、値が設定ファイル内で変更されたが再起動が必要。 それ以外はfalse


There are several possible values of <structfield>context</structfield>. In order of decreasing difficulty of changing the setting, they are: contextが取り得る値は複数あります。 この設定の変更の困難さを軽くするために、以下に示します。

internal

These settings cannot be changed directly; they reflect internally determined values. Some of them may be adjustable by rebuilding the server with different configuration options, or by changing options supplied to <application>initdb</application>. これらの設定は直接変更できません。 これらは内部で決定された値を反映するものです。 一部は異なる設定オプションでサーバを再構築する、または、initdbに与えるオプションを変更することで調整できます。

postmaster

These settings can only be applied when the server starts, so any change requires restarting the server. Values for these settings are typically stored in the <filename>postgresql.conf</filename> file, or passed on the command line when starting the server. Of course, settings with any of the lower <structfield>context</structfield> types can also be set at server start time. これらの設定はサーバ起動時にのみ適用できます。 このため何かを変更するためにはサーバを再起動しなければなりません。 これらの設定用の値は通常postgresql.confファイル内に格納されている、あるいは、サーバを起動する際のコマンドラインから渡されます。 当然ながら、より低い種類のcontextを持つ設定もサーバ起動時に設定できます。

sighup

Changes to these settings can be made in <filename>postgresql.conf</filename> without restarting the server. Send a <systemitem>SIGHUP</systemitem> signal to the postmaster to cause it to re-read <filename>postgresql.conf</filename> and apply the changes. The postmaster will also forward the <systemitem>SIGHUP</systemitem> signal to its child processes so that they all pick up the new value. これらの設定は、サーバを再起動することなくpostgresql.conf内を変更することで行うことができます。 postgresql.confを再度読み込み、変更を適用させるためには、postmasterにSIGHUPシグナルを送信してください。 すべての子プロセスが新しい値を選択するように、postmasterは同時に子プロセスにSIGHUPシグナルを転送します。

superuser-backend

Changes to these settings can be made in <filename>postgresql.conf</filename> without restarting the server. They can also be set for a particular session in the connection request packet (for example, via <application>libpq</application>'s <literal>PGOPTIONS</literal> environment variable), but only if the connecting user is a superuser or has been granted the appropriate <literal>SET</literal> privilege. However, these settings never change in a session after it is started. If you change them in <filename>postgresql.conf</filename>, send a <systemitem>SIGHUP</systemitem> signal to the postmaster to cause it to re-read <filename>postgresql.conf</filename>. The new values will only affect subsequently-launched sessions. これらの設定は、サーバを再起動することなくpostgresql.conf内を変更することで行うことができます。 また、接続要求パケットの中で特定のセッション向けに設定することもできます(例えばlibpqPGOPTIONS環境変数)が、これは接続ユーザがスーパーユーザか、適切なSET権限を与えられたユーザの場合に限られます。 しかし、これらの設定はセッションが開始してから、そのセッションの中で変更することはできません。 postgresql.conf内でそれらを変更した場合は、postgresql.confを再度読み込ませるために、postmasterにSIGHUPシグナルを送信してください。 新しい値はその後で始まったセッションにのみ影響を与えます。

backend

Changes to these settings can be made in <filename>postgresql.conf</filename> without restarting the server. They can also be set for a particular session in the connection request packet (for example, via <application>libpq</application>'s <literal>PGOPTIONS</literal> environment variable); any user can make such a change for their session. However, these settings never change in a session after it is started. If you change them in <filename>postgresql.conf</filename>, send a <systemitem>SIGHUP</systemitem> signal to the postmaster to cause it to re-read <filename>postgresql.conf</filename>. The new values will only affect subsequently-launched sessions. これらの設定は、サーバを再起動することなくpostgresql.conf内を変更することで行うことができます。 また、接続要求パケットの中で特定のセッション向けに設定することもできます(例えばlibpqPGOPTIONS環境変数)。 どのユーザでも、自分のセッション向けにそのような変更ができます。 しかし、これらの設定はセッションが開始してから、そのセッションの中で変更することはできません。 postgresql.conf内でそれらを変更した場合は、postgresql.confを再度読み込ませるために、postmasterにSIGHUPシグナルを送信してください。 新しい値はその後で始まったセッションにのみ影響を与えます。

superuser

These settings can be set from <filename>postgresql.conf</filename>, or within a session via the <command>SET</command> command; but only superusers and users with the appropriate <literal>SET</literal> privilege can change them via <command>SET</command>. Changes in <filename>postgresql.conf</filename> will affect existing sessions only if no session-local value has been established with <command>SET</command>. これらの設定はpostgresql.conf、または、セッションの中でSETコマンドを使用することで設定ができます。 しかしSET経由で変更できるのは、接続するユーザがスーパーユーザか、適切なSET権限を与えられたユーザに限られます。 postgresql.conf内の変更は、セッション独自の値がSETで設定されていない場合にのみ、既存のセッションに影響を与えます。

user

These settings can be set from <filename>postgresql.conf</filename>, or within a session via the <command>SET</command> command. Any user is allowed to change their session-local value. Changes in <filename>postgresql.conf</filename> will affect existing sessions only if no session-local value has been established with <command>SET</command>. これらの設定はpostgresql.conf、または、セッションの中でSETコマンドを使用することで設定ができます。 任意のユーザが自身のセッション独自の値を変更することが許されています。 postgresql.conf内の変更は、セッション独自の値がSETで設定されていない場合にのみ、既存のセッションに影響を与えます。

See <xref linkend="config-setting"/> for more information about the various ways to change these parameters. これらのパラメータを変更する各種方法に関する情報については20.1を参照してください。

This view cannot be inserted into or deleted from, but it can be updated. An <command>UPDATE</command> applied to a row of <structname>pg_settings</structname> is equivalent to executing the <command>SET</command> command on that named parameter. The change only affects the value used by the current session. If an <command>UPDATE</command> is issued within a transaction that is later aborted, the effects of the <command>UPDATE</command> command disappear when the transaction is rolled back. Once the surrounding transaction is committed, the effects will persist until the end of the session, unless overridden by another <command>UPDATE</command> or <command>SET</command>. このビューには挿入も削除もできませんが、更新することは可能です。 pg_settingsの行へ適用されたUPDATEは、SETコマンドを名前付きの引数に対して実行するのと同等です。 pg_settings行に適用されるUPDATEは名前付きのパラメータに対してSETコマンドを実行することと同値です。 変更は現在のセッションで使用されている値にのみ有効です。 もしも後に中止されるトランザクション内でUPDATEが発行されると、トランザクションがロールバックされた時点でUPDATEコマンドは効力を失います。 排他制御中のトランザクションがひとたびコミットされると、その効果は他のUPDATEもしくはSETコマンドで上書きされない限りセッションの完了まで保たれます。

This view does not display <link linkend="runtime-config-custom">customized options</link> unless the extension module that defines them has been loaded by the backend process executing the query (e.g., via a mention in <xref linkend="guc-shared-preload-libraries"/>, a call to a C function in the extension, or the <link linkend="sql-load"><command>LOAD</command></link> command). For example, since <link linkend="archive-modules">archive modules</link> are normally loaded only by the archiver process not regular sessions, this view will not display any customized options defined by such modules unless special action is taken to load them into the backend process executing the query. カスタマイズオプションを定義する拡張モジュールが、クエリを実行するバックエンドプロセスによって(たとえばshared_preload_librariesで記述された方法、拡張モジュール内のC関数の呼び出し、LOADコマンドなどによって)ロードされていない限り、このビューには表示されません。 たとえば、アーカイブモジュールは通常、通常のセッションではなくアーカイバプロセスによってのみロードされるため、クエリを実行するバックエンドプロセスにロードするための特別なアクションがとられていない限り、このビューにはこれらのモジュールによって定義されたカスタマイズされたオプションは表示されません。