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

21.5. 定義済みロール #

<title>Predefined Roles</title>

<productname>PostgreSQL</productname> provides a set of predefined roles that provide access to certain, commonly needed, privileged capabilities and information. Administrators (including roles that have the <literal>CREATEROLE</literal> privilege) can <command>GRANT</command> these roles to users and/or other roles in their environment, providing those users with access to the specified capabilities and information. For example: PostgreSQLでは、一般的に必要とされる、特権のある機能や情報にアクセスできるよう、いくつかのあらかじめ定義されたロールを提供しています。 管理者(CREATEROLE権限を持つロールを含む)は自分の環境のユーザあるいは他のロールに対し、これらのロールをGRANT(付与)することで、それらのユーザに、その機能や情報を提供することができます。 例えば以下です。

GRANT pg_signal_backend TO admin_user;

警告

Care should be taken when granting these roles to ensure they are only used where needed and with the understanding that these roles grant access to privileged information. これらのロールを付与する場合、機密情報へのアクセス権が与えられるということを理解したうえで、必要な場合にのみ使用されるように注意する必要があります。

The predefined roles are described below. Note that the specific permissions for each of the roles may change in the future as additional capabilities are added. Administrators should monitor the release notes for changes. 定義済みロールについては以下で説明します。 それぞれのロールの個別の権限については、将来、さらなる機能が追加される時に変更されるかもしれないことに注意してください。 管理者は、変更がないかリリースノートを確認するようにしてください。

pg_checkpoint #

<literal>pg_checkpoint</literal> allows executing the <link linkend="sql-checkpoint"><command>CHECKPOINT</command></link> command. pg_checkpointは、CHECKPOINTコマンドの実行を許可します。

pg_create_subscription #

<literal>pg_create_subscription</literal> allows users with <literal>CREATE</literal> permission on the database to issue <link linkend="sql-createsubscription"><command>CREATE SUBSCRIPTION</command></link>. pg_create_subscriptionは、データベースでのCREATE権限を持つユーザに対して、CREATE SUBSCRIPTIONの実行を許可します。

pg_database_owner #

<literal>pg_database_owner</literal> always has exactly one implicit member: the current database owner. It cannot be granted membership in any role, and no role can be granted membership in <literal>pg_database_owner</literal>. However, like any other role, it can own objects and receive grants of access privileges. Consequently, once <literal>pg_database_owner</literal> has rights within a template database, each owner of a database instantiated from that template will possess those rights. Initially, this role owns the <literal>public</literal> schema, so each database owner governs local use of that schema. pg_database_ownerロールには、暗黙的なメンバが常に1つだけあります。 すなわち、現在のデータベースの所有者です。 どのロールにもメンバ資格を付与することはできませんし、pg_database_ownerのメンバ資格を付与できるロールもありません。 ただし、他のロールと同様に、オブジェクトを所有したりアクセス権限の付与を受けたりすることはできます。 したがって、pg_database_ownerがテンプレートデータベース内で権限を一度持てば、そのテンプレートから作成されたデータベースの所有者は皆、その権限を持つことになります。 最初は、このロールはpublicスキーマを所有していますので、各データベースの所有者がそのスキーマのローカルでの使用を管理します。

pg_maintain #

<literal>pg_maintain</literal> allows executing <link linkend="sql-vacuum"><command>VACUUM</command></link>, <link linkend="sql-analyze"><command>ANALYZE</command></link>, <link linkend="sql-cluster"><command>CLUSTER</command></link>, <link linkend="sql-refreshmaterializedview"><command>REFRESH MATERIALIZED VIEW</command></link>, <link linkend="sql-reindex"><command>REINDEX</command></link>, and <link linkend="sql-lock"><command>LOCK TABLE</command></link> on all relations, as if having <literal>MAINTAIN</literal> rights on those objects. pg_maintainは、MAINTAIN権限があるかのように、すべてのリレーションに対してVACUUMANALYZECLUSTERREFRESH MATERIALIZED VIEWREINDEX、およびLOCK TABLEを実行することを許可します。

pg_monitor
pg_read_all_settings
pg_read_all_stats
pg_stat_scan_tables #

These roles are intended to allow administrators to easily configure a role for the purpose of monitoring the database server. They grant a set of common privileges allowing the role to read various useful configuration settings, statistics, and other system information normally restricted to superusers. これらのロールは、管理者がデータベースサーバを監視するためのロールを簡単に設定できるようにすることを目的としています。 これらのロールは、通常はスーパーユーザに制限されている、各種の有用な構成設定、統計情報、および他のシステム情報を読み取るための一般的な権限のセットを付与することができます。

<literal>pg_monitor</literal> allows reading/executing various monitoring views and functions. This role is a member of <literal>pg_read_all_settings</literal>, <literal>pg_read_all_stats</literal> and <literal>pg_stat_scan_tables</literal>. pg_monitorは、各種の監視ビューや関数を読み取ること/実行することを許可します。 このロールは、pg_read_all_settingspg_read_all_stats、およびpg_stat_scan_tablesのメンバです。

<literal>pg_read_all_settings</literal> allows reading all configuration variables, even those normally visible only to superusers. pg_read_all_settingsは、通常スーパーユーザのみに見える、すべての設定変数を読み取ることを許可します。

<literal>pg_read_all_stats</literal> allows reading all pg_stat_* views and use various statistics related extensions, even those normally visible only to superusers. pg_read_all_statsは、通常スーパーユーザのみに見える、すべてのpg_stat_*ビューの読み取りと各種統計関連の拡張の使用を許可します。

<literal>pg_stat_scan_tables</literal> allows executing monitoring functions that may take <literal>ACCESS SHARE</literal> locks on tables, potentially for a long time (e.g., <function>pgrowlocks(text)</function> in the <xref linkend="pgrowlocks"/> extension). pg_stat_scan_tablesは、潜在的にテーブルに対して長時間ACCESS SHAREロックを取得する可能性がある関数(例えばpgrowlocks拡張のpgrowlocks(text))の監視を行うことを許可します。

pg_read_all_data
pg_write_all_data #

<literal>pg_read_all_data</literal> allows reading all data (tables, views, sequences), as if having <command>SELECT</command> rights on those objects and <literal>USAGE</literal> rights on all schemas. This role does not bypass row-level security (RLS) policies. If RLS is being used, an administrator may wish to set <literal>BYPASSRLS</literal> on roles which this role is granted to. pg_read_all_dataは、すべてのデータ(テーブル、ビュー、シーケンス)について、これらのオブジェクトのSELECT権限とすべてのスキーマのUSAGE権限を持っているかのように読み取ることを許可します。 このロールは、行レベルセキュリティ(RLS)ポリシーを無視しません。 RLSが使用されている場合、管理者はこのロールが付与されているロールに対してBYPASSRLSを設定したいと思うかもしれません。

<literal>pg_write_all_data</literal> allows writing all data (tables, views, sequences), as if having <command>INSERT</command>, <command>UPDATE</command>, and <command>DELETE</command> rights on those objects and <literal>USAGE</literal> rights on all schemas. This role does not bypass row-level security (RLS) policies. If RLS is being used, an administrator may wish to set <literal>BYPASSRLS</literal> on roles which this role is granted to. pg_write_all_dataは、すべてのデータ(テーブル、ビュー、シーケンス)について、これらのオブジェクトのINSERTUPDATE、およびDELETE権限とすべてのスキーマのUSAGE権限を持っているかのように書き込むことを許可します。 このロールは、行レベルセキュリティ(RLS)ポリシーを無視しません。 RLSが使用されている場合、管理者はこのロールが付与されているロールに対してBYPASSRLSを設定したいと思うかもしれません。

pg_read_server_files
pg_write_server_files
pg_execute_server_program #

These roles are intended to allow administrators to have trusted, but non-superuser, roles which are able to access files and run programs on the database server as the user the database runs as. They bypass all database-level permission checks when accessing files directly and they could be used to gain superuser-level access. Therefore, great care should be taken when granting these roles to users. これらのロールは、信頼はできるがスーパーユーザではないロールが、データベースを実行するユーザとしてデータベースサーバ上のファイルにアクセスしたりプログラムを実行したりすることを、管理者が許可できるようにすることを意図しています。 これらのロールは、ファイルに直接アクセスする時はデータベースレベルの権限確認をすべて無視し、スーパーユーザレベルのアクセス権を取得するために使用できます。 そのため、これらのロールをユーザに付与する時には細心の注意が必要です。

<literal>pg_read_server_files</literal> allows reading files from any location the database can access on the server using <command>COPY</command> and other file-access functions. pg_read_server_filesは、COPYやその他のファイルアクセス関数を使用して、データベースがサーバ上でアクセスできる任意の場所からファイルを読み取ることを許可します。

<literal>pg_write_server_files</literal> allows writing to files in any location the database can access on the server using <command>COPY</command> and other file-access functions. pg_write_server_filesは、COPYやその他のファイルアクセス関数を使用して、データベースがサーバ上でアクセスできる任意の場所のファイルに書き込むことを許可します。

<literal>pg_execute_server_program</literal> allows executing programs on the database server as the user the database runs as using <command>COPY</command> and other functions which allow executing a server-side program. pg_execute_server_programは、COPYやサーバ側のプログラムを実行できるその他の関数で、データベースを実行しているユーザとしてデータベースサーバ上でプログラムを実行することを許可します。

pg_signal_autovacuum_worker #

<literal>pg_signal_autovacuum_worker</literal> allows signaling autovacuum workers to cancel the current table's vacuum or terminate its session. See <xref linkend="functions-admin-signal"/>. pg_signal_autovacuum_workerは、自動バキュームワーカーに対して、現在のテーブルのバキュームをキャンセルしたりそのセッションを終了させたりするためのシグナルを送信することを許可します。 9.28.2を参照してください。

pg_signal_backend #

<literal>pg_signal_backend</literal> allows signaling another backend to cancel a query or terminate its session. Note that this role does not permit signaling backends owned by a superuser. See <xref linkend="functions-admin-signal"/>. pg_signal_backendは、他のバックエンドに対して、問い合わせをキャンセルしたりそのセッションを終了させたりするためのシグナルを送信することを許可します。 このロールでは、スーパーユーザが所有するバックエンドに対してシグナルを送信することは許可されないことに注意してください。 9.28.2を参照してください。

pg_use_reserved_connections #

<literal>pg_use_reserved_connections</literal> allows use of connection slots reserved via <xref linkend="guc-reserved-connections"/>. pg_use_reserved_connectionsは、reserved_connectionsによって予約済みの接続スロットを使用することを許可します。