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

23.4. データベースの設定 #

<title>Database Configuration</title>

Recall from <xref linkend="runtime-config"/> that the <productname>PostgreSQL</productname> server provides a large number of run-time configuration variables. You can set database-specific default values for many of these settings. 第20章で説明したように、PostgreSQLサーバには多数の実行時の設定変数が存在します。 これらの設定の多くに対して、データベース固有のデフォルト値を設定できます。

For example, if for some reason you want to disable the <acronym>GEQO</acronym> optimizer for a given database, you'd ordinarily have to either disable it for all databases or make sure that every connecting client is careful to issue <literal>SET geqo TO off</literal>. To make this setting the default within a particular database, you can execute the command: 例えば、何らかの理由で特定のデータベースについてGEQOオプティマイザを無効にしたい場合、通常はすべてのデータベースでこれを無効にするか、またはすべての接続しているクライアントで間違いなくSET geqo TO off;が実行されていることを確認する必要があります。 特定のデータベースでこの設定をデフォルトにするには、次のコマンドを実行します。

ALTER DATABASE mydb SET geqo TO off;

This will save the setting (but not set it immediately). In subsequent connections to this database it will appear as though <literal>SET geqo TO off;</literal> had been executed just before the session started. Note that users can still alter this setting during their sessions; it will only be the default. To undo any such setting, use <literal>ALTER DATABASE <replaceable>dbname</replaceable> RESET <replaceable>varname</replaceable></literal>. これにより設定が保存されます(ただし、すぐに反映はされません)。 以降のこのデータベースに対する接続においては、セッションの開始の直前にSET geqo TO off;が呼び出されたのと同様になります。 これはデフォルトでしかありませんので、ユーザはセッションの途中であってもこの設定を変更できます。 このような設定を解除するには、ALTER DATABASE dbname RESET varnameを使用します。