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

GRANT

GRANT <refpurpose>define access privileges</refpurpose> — アクセス権限を定義する

概要

GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
    [, ...] | ALL [ PRIVILEGES ] }
    ON { [ TABLE ] table_name [, ...]
         | ALL TABLES IN SCHEMA schema_name [, ...] }
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { { SELECT | INSERT | UPDATE | REFERENCES } ( column_name [, ...] )
    [, ...] | ALL [ PRIVILEGES ] ( column_name [, ...] ) }
    ON [ TABLE ] table_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { { USAGE | SELECT | UPDATE }
    [, ...] | ALL [ PRIVILEGES ] }
    ON { SEQUENCE sequence_name [, ...]
         | ALL SEQUENCES IN SCHEMA schema_name [, ...] }
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { { CREATE | CONNECT | TEMPORARY | TEMP } [, ...] | ALL [ PRIVILEGES ] }
    ON DATABASE database_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { USAGE | ALL [ PRIVILEGES ] }
    ON DOMAIN domain_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { USAGE | ALL [ PRIVILEGES ] }
    ON FOREIGN DATA WRAPPER fdw_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { USAGE | ALL [ PRIVILEGES ] }
    ON FOREIGN SERVER server_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { EXECUTE | ALL [ PRIVILEGES ] }
    ON { { FUNCTION | PROCEDURE | ROUTINE } routine_name [ ( [ [ argmode ] [ arg_name ] arg_type [, ...] ] ) ] [, ...]
         | ALL { FUNCTIONS | PROCEDURES | ROUTINES } IN SCHEMA schema_name [, ...] }
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { USAGE | ALL [ PRIVILEGES ] }
    ON LANGUAGE lang_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { { SELECT | UPDATE } [, ...] | ALL [ PRIVILEGES ] }
    ON LARGE OBJECT loid [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { { SET | ALTER SYSTEM } [, ... ] | ALL [ PRIVILEGES ] }
    ON PARAMETER configuration_parameter [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { { CREATE | USAGE } [, ...] | ALL [ PRIVILEGES ] }
    ON SCHEMA schema_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { CREATE | ALL [ PRIVILEGES ] }
    ON TABLESPACE tablespace_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT { USAGE | ALL [ PRIVILEGES ] }
    ON TYPE type_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
    [ GRANTED BY role_specification ]

GRANT role_name [, ...] TO role_specification [, ...]
    [ WITH { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ]
    [ GRANTED BY role_specification ]


<phrase>where <replaceable class="parameter">role_specification</replaceable> can be:</phrase>

ここでrole_specificationは以下の通りです。

    [ GROUP ] role_name
  | PUBLIC
  | CURRENT_ROLE
  | CURRENT_USER
  | SESSION_USER

説明

<title>Description</title>

The <command>GRANT</command> command has two basic variants: one that grants privileges on a database object (table, column, view, foreign table, sequence, database, foreign-data wrapper, foreign server, function, procedure, procedural language, large object, configuration parameter, schema, tablespace, or type), and one that grants membership in a role. These variants are similar in many ways, but they are different enough to be described separately. GRANTには基本的に2つの種類があります。 1つはデータベースオブジェクト(テーブル、列、ビュー、外部テーブル、シーケンス、データベース、外部データラッパー、外部サーバ、関数、プロシージャ、手続き言語、ラージオブジェクト、設定パラメータ、スキーマ、テーブル空間、型)に対する権限の付与、もう1つはロール内のメンバ資格の付与です。 これらの種類は多くの点で似ていますが、説明は別々に行わなければならない程違いがあります。

データベースオブジェクトに対するGRANT

<title>GRANT on Database Objects</title>

This variant of the <command>GRANT</command> command gives specific privileges on a database object to one or more roles. These privileges are added to those already granted, if any. この種類のGRANTコマンドはデータベースオブジェクトの特定の権限を1つ以上のロールに付与します。 既に権限が他のロールに付与されている場合でも、追加として付与されます。

The key word <literal>PUBLIC</literal> indicates that the privileges are to be granted to all roles, including those that might be created later. <literal>PUBLIC</literal> can be thought of as an implicitly defined group that always includes all roles. Any particular role will have the sum of privileges granted directly to it, privileges granted to any role it is presently a member of, and privileges granted to <literal>PUBLIC</literal>. PUBLICキーワードは、今後作成されるロールを含む、全てのロールへの許可を示します。 PUBLICは、全てのロールを常に含む、暗黙的に定義されたグループと考えることができます。 個々のロールは全て、ロールに直接許可された権限、ロールが現在属しているロールに許可された権限、そして、PUBLICに許可された権限を合わせた権限を持っています。

If <literal>WITH GRANT OPTION</literal> is specified, the recipient of the privilege can in turn grant it to others. Without a grant option, the recipient cannot do that. Grant options cannot be granted to <literal>PUBLIC</literal>. WITH GRANT OPTIONが指定されると、権限の受領者は、その後、他にその権限を与えることができます。 グラントオプションがない場合、受領者はこれを行うことができません。 グラントオプションはPUBLICには与えることができません。

If <literal>GRANTED BY</literal> is specified, the specified grantor must be the current user. This clause is currently present in this form only for SQL compatibility. GRANTED BYが指定されると、指定された付与する者は現在のユーザでなければなりません。 この句はSQLとの互換性のためにのみ現在この形で存在しています。

There is no need to grant privileges to the owner of an object (usually the user that created it), as the owner has all privileges by default. (The owner could, however, choose to revoke some of their own privileges for safety.) 所有者(通常はオブジェクトを作成したユーザ)はデフォルトで全ての権限を保持しているため、オブジェクトの所有者に権限を許可する必要はありません (ただし、オブジェクトの作成者が、安全性のために自らの権限を取り消すことは可能です)。

The right to drop an object, or to alter its definition in any way, is not treated as a grantable privilege; it is inherent in the owner, and cannot be granted or revoked. (However, a similar effect can be obtained by granting or revoking membership in the role that owns the object; see below.) The owner implicitly has all grant options for the object, too. オブジェクトを削除する権限や何らかの方法でオブジェクトの定義を変更する権限は、付与可能な権限として扱われません。 これらの権限は、所有者固有のものであり、許可したり取り消したりすることはできません。 (しかし、オブジェクトを所有するロール内のメンバ関係を付与したり取り消すことで、同等な効果を得ることができます。 後で説明します。) 所有者は、オブジェクトに対する全てのグラントオプションも暗黙的に保持しています。

The possible privileges are: 設定可能な権限は以下のものです。

SELECT
INSERT
UPDATE
DELETE
TRUNCATE
REFERENCES
TRIGGER
CREATE
CONNECT
TEMPORARY
EXECUTE
USAGE
SET
ALTER SYSTEM

Specific types of privileges, as defined in <xref linkend="ddl-priv"/>. 権限の特定の種類です。5.7で定義されています。

TEMP

Alternative spelling for <literal>TEMPORARY</literal>. TEMPORARYの別の綴り方です。

ALL PRIVILEGES

Grant all of the privileges available for the object's type. The <literal>PRIVILEGES</literal> key word is optional in <productname>PostgreSQL</productname>, though it is required by strict SQL. 対象の型に対して利用可能な全ての権限を一度に付与します。 PRIVILEGESキーワードはPostgreSQLでは省略可能ですが、厳密なSQLでは必須です。

The <literal>FUNCTION</literal> syntax works for plain functions, aggregate functions, and window functions, but not for procedures; use <literal>PROCEDURE</literal> for those. Alternatively, use <literal>ROUTINE</literal> to refer to a function, aggregate function, window function, or procedure regardless of its precise type. FUNCTION構文は通常の関数、集約関数、ウィンドウ関数に対して有効ですが、プロシージャには有効ではありません。プロシージャにはPROCEDUREを使ってください。 あるいは、関数、集約関数、プロシージャを参照するのに、その正確な種類に関係なくROUTINEを使ってください。

There is also an option to grant privileges on all objects of the same type within one or more schemas. This functionality is currently supported only for tables, sequences, functions, and procedures. <literal>ALL TABLES</literal> also affects views and foreign tables, just like the specific-object <command>GRANT</command> command. <literal>ALL FUNCTIONS</literal> also affects aggregate and window functions, but not procedures, again just like the specific-object <command>GRANT</command> command. Use <literal>ALL ROUTINES</literal> to include procedures. 1つまたは複数のスキーマ内で同じ型のオブジェクトすべてに対する権限を付与するオプションもあります。 この機能は現在、テーブル、シーケンス、関数、プロシージャだけをサポートしています。 ALL TABLESは、特定の対象のGRANTコマンドと同様に、ビューや外部テーブルにも影響します。 ALL FUNCTIONSは、集約関数やウィンドウ関数にも影響しますが、プロシージャには影響しません。ここでも、特定の対象のGRANTコマンドと同様です。 プロシージャを含めるにはALL ROUTINESを使ってください。

ロールに対するGRANT

<title>GRANT on Roles</title>

This variant of the <command>GRANT</command> command grants membership in a role to one or more other roles. Membership in a role is significant because it potentially allows access to the privileges granted to a role to each of its members, and potentially also the ability to make changes to the role itself. However, the actual permissions conferred depend on the options associated with the grant. この種類のGRANTコマンドは、ロール内のメンバ資格を1つ以上の他のロールに付与します。 これにより各メンバがロールに付与された権限にアクセスできるようになる可能性があり、またロール自身を変更する能力が与えられる可能性があるので、ロール内のメンバ資格は重要です。 ただし、付与される実際の権限は、付与に関連付けられたオプションによって異なります。

Each of the options described below can be set to either <literal>TRUE</literal> or <literal>FALSE</literal>. The keyword <literal>OPTION</literal> is accepted as a synonym for <literal>TRUE</literal>, so that <literal>WITH ADMIN OPTION</literal> is a synonym for <literal>WITH ADMIN TRUE</literal>. 以下の各オプションは、TRUEまたはFALSEのいずれかに設定できます。 キーワードOPTIONTRUEの同義語として受け入れられますので、WITH ADMIN OPTIONWITH ADMIN TRUEの同義語です。

The <literal>ADMIN</literal> option allows the member to in turn grant membership in the role to others, and revoke membership in the role as well. Without the admin option, ordinary users cannot do that. A role is not considered to hold <literal>WITH ADMIN OPTION</literal> on itself. Database superusers can grant or revoke membership in any role to anyone. This option defaults to <literal>FALSE</literal>. ADMINオプションを使用すると、メンバはロールのメンバ資格を他のメンバに付与したり、ロールのメンバ資格を取り消したりすることができます。 アドミンオプションがないと、一般ユーザは他への権限の付与や取り消しを行うことができません。 ロールは自分自身に対してWITH ADMIN OPTIONを保持しているとはみなされません。 データベーススーパーユーザはすべてのロール内のメンバ資格を誰にでも付与したり、取り消したりすることができます。 このオプションのデフォルトはFALSEです。

The <literal>INHERIT</literal> option, if it is set to <literal>TRUE</literal>, causes the member to inherit the privileges of the granted role. That is, it can automatically use whatever database privileges have been granted to that role. If set to <literal>FALSE</literal>, the member does not inherit the privileges of the granted role. If this clause is not specified, it defaults to true if the member role is set to <literal>INHERIT</literal> and to false if the member role is set to <literal>NOINHERIT</literal>. See <link linkend="sql-createrole"><command>CREATE ROLE</command></link>. INHERITオプションがTRUEに設定されている場合、メンバは付与されたロールの権限を継承します。 つまり、そのロールに付与されているデータベース権限は何でも自動的に使用できます。 FALSEに設定されている場合、メンバは付与されたロールの権限を継承しません。 この句が指定されていない場合、メンバロールがINHERITに設定されていれば真がデフォルトになり、メンバロールがNOINHERITに設定されていれば偽がデフォルトになります。 CREATE ROLEを参照してください。

The <literal>SET</literal> option, if it is set to <literal>TRUE</literal>, allows the member to change to the granted role using the <link linkend="sql-set-role"><command>SET ROLE</command></link> command. If a role is an indirect member of another role, it can use <literal>SET ROLE</literal> to change to that role only if there is a chain of grants each of which has <literal>SET TRUE</literal>. This option defaults to <literal>TRUE</literal>. SETオプションがTRUEに設定されている場合、SET ROLEコマンドを使用して、メンバを付与されたロールに変更できます。 あるロールが別のロールの間接メンバである場合、それぞれSET TRUEを持つ権限付与のチェーンがある場合にのみ、SET ROLEを使用してそのロールに変更できます。 このオプションのデフォルトはTRUEです。

To create an object owned by another role or give ownership of an existing object to another role, you must have the ability to <literal>SET ROLE</literal> to that role; otherwise, commands such as <literal>ALTER ... OWNER TO</literal> or <literal>CREATE DATABASE ... OWNER</literal> will fail. However, a user who inherits the privileges of a role but does not have the ability to <literal>SET ROLE</literal> to that role may be able to obtain full access to the role by manipulating existing objects owned by that role (e.g. they could redefine an existing function to act as a Trojan horse). Therefore, if a role's privileges are to be inherited but should not be accessible via <literal>SET ROLE</literal>, it should not own any SQL objects. 別のロールが所有するオブジェクトを作成する場合、または既存のオブジェクトの所有権を別のロールに付与する場合は、そのロールに対してSET ROLEを実行できることが必要です。 そうでない場合、ALTER ... OWNER TOCREATE DATABASE ... OWNERなどのコマンドは失敗します。 ただし、ロールの権限を継承しているものの、そのロールに対してSET ROLEを実行できないユーザは、そのロールが所有する既存のオブジェクトを操作することで、そのロールに対して完全なアクセスを取得できるかもしれません(たとえば、既存の関数を再定義してトロイの木馬として機能させることができます)。 したがって、ロールの権限を継承するものの、SET ROLEを介してアクセスできないようにする場合は、いかなるSQLオブジェクトも所有すべきではありません。

If <literal>GRANTED BY</literal> is specified, the grant is recorded as having been done by the specified role. A user can only attribute a grant to another role if they possess the privileges of that role. The role recorded as the grantor must have <literal>ADMIN OPTION</literal> on the target role, unless it is the bootstrap superuser. When a grant is recorded as having a grantor other than the bootstrap superuser, it depends on the grantor continuing to possess <literal>ADMIN OPTION</literal> on the role; so, if <literal>ADMIN OPTION</literal> is revoked, dependent grants must be revoked as well. GRANTED BYが指定された場合、付与は指定されたロールにより行なわれたと記録されます。 ユーザが別のロールに権限を付与できるのは、そのロールの権限を所有している場合のみです。 付与者として記録されるロールは、対象のロールに対してADMIN OPTIONを持っていることが必要です。ただし、ブートストラップスーパーユーザの場合は除きます。 ブートストラップスーパーユーザ以外の付与者を持っていると記録されている付与は、そのロールに対してADMIN OPTIONを引き続き所有している付与者に依存します。したがって、ADMIN OPTIONが取り消された場合、依存する付与も取り消さなければなりません。

Unlike the case with privileges, membership in a role cannot be granted to <literal>PUBLIC</literal>. Note also that this form of the command does not allow the noise word <literal>GROUP</literal> in <replaceable class="parameter">role_specification</replaceable>. 権限の場合と異なり、ロール内のメンバ資格をPUBLICに付与することはできません。 また、このコマンド構文では、role_specificationで無意味なGROUPという単語を受け付けないことに注意してください。

注釈

<title>Notes</title>

The <link linkend="sql-revoke"><command>REVOKE</command></link> command is used to revoke access privileges. アクセス権限を取り消すには、REVOKEコマンドが使用されます。

Since <productname>PostgreSQL</productname> 8.1, the concepts of users and groups have been unified into a single kind of entity called a role. It is therefore no longer necessary to use the keyword <literal>GROUP</literal> to identify whether a grantee is a user or a group. <literal>GROUP</literal> is still allowed in the command, but it is a noise word. PostgreSQL 8.1から、ユーザとグループという概念は、ロールと呼ばれる1種類の実体に統合されました。 そのため、付与される者がユーザかグループかどうかを識別するためにGROUPキーワードを使用する必要はなくなりました。 このコマンドではまだGROUPを使うことはできますが、何の意味もありません。

A user may perform <command>SELECT</command>, <command>INSERT</command>, etc. on a column if they hold that privilege for either the specific column or its whole table. Granting the privilege at the table level and then revoking it for one column will not do what one might wish: the table-level grant is unaffected by a column-level operation. ユーザは特定の列あるいはテーブル全体に対する権限を持つ場合にSELECTINSERTなどを実行することができます。 テーブルレベルの権限を付与してからある列に対する権限を取り消しても、望むことは実現できません。 テーブルレベルの権限は列レベルの操作による影響を受けないからです。

When a non-owner of an object attempts to <command>GRANT</command> privileges on the object, the command will fail outright if the user has no privileges whatsoever on the object. As long as some privilege is available, the command will proceed, but it will grant only those privileges for which the user has grant options. The <command>GRANT ALL PRIVILEGES</command> forms will issue a warning message if no grant options are held, while the other forms will issue a warning if grant options for any of the privileges specifically named in the command are not held. (In principle these statements apply to the object owner as well, but since the owner is always treated as holding all grant options, the cases can never occur.) オブジェクトの所有者でもなく、そのオブジェクトに何の権限も持たないユーザが、そのオブジェクトの権限をGRANTしようとしても、コマンドの実行は直ちに失敗します。 何らかの権限を持っている限り、コマンドの実行は進行しますが、与えることのできる権限は、そのユーザがグラントオプションを持つ権限のみです。 グラントオプションを持っていない場合、GRANT ALL PRIVILEGES構文は警告メッセージを発します。 一方、その他の構文では、コマンドで名前を指定した権限に関するグラントオプションを持っていない場合に警告メッセージを発します (原理上、ここまでの説明はオブジェクトの所有者に対しても当てはまりますが、所有者は常に全てのグラントオプションを保持しているものとして扱われるため、こうした状態は決して起こりません)。

It should be noted that database superusers can access all objects regardless of object privilege settings. This is comparable to the rights of <literal>root</literal> in a Unix system. As with <literal>root</literal>, it's unwise to operate as a superuser except when absolutely necessary. データベーススーパーユーザは、オブジェクトに関する権限設定に関係なく、全てのオブジェクトにアクセスできることには注意しなければなりません。 スーパーユーザが持つ権限は、Unixシステムにおけるroot権限に似ています。 rootと同様、どうしても必要という場合以外は、スーパーユーザとして操作を行わないのが賢明です。

If a superuser chooses to issue a <command>GRANT</command> or <command>REVOKE</command> command, the command is performed as though it were issued by the owner of the affected object. In particular, privileges granted via such a command will appear to have been granted by the object owner. (For role membership, the membership appears to have been granted by the bootstrap superuser.) スーパーユーザがGRANTREVOKEコマンドの発行を選択した場合、それらのコマンドは対象とするオブジェクトの所有者が発行したかのように実行されます。 特に、こうしたコマンドで与えられる権限は、オブジェクトの所有者によって与えられたものとして表されます。 (ロールのメンバ資格では、メンバ資格はブートストラップスーパーユーザが与えたものとして表されます。)

<command>GRANT</command> and <command>REVOKE</command> can also be done by a role that is not the owner of the affected object, but is a member of the role that owns the object, or is a member of a role that holds privileges <literal>WITH GRANT OPTION</literal> on the object. In this case the privileges will be recorded as having been granted by the role that actually owns the object or holds the privileges <literal>WITH GRANT OPTION</literal>. For example, if table <literal>t1</literal> is owned by role <literal>g1</literal>, of which role <literal>u1</literal> is a member, then <literal>u1</literal> can grant privileges on <literal>t1</literal> to <literal>u2</literal>, but those privileges will appear to have been granted directly by <literal>g1</literal>. Any other member of role <literal>g1</literal> could revoke them later. GRANTおよびREVOKEは、対象のオブジェクトの所有者以外のロールによって実行することもできますが、 オブジェクトを所有するロールのメンバであるか、そのオブジェクトに対しWITH GRANT OPTION権限を持つロールのメンバでなければなりません。 この場合、その権限は、そのオブジェクトの実際の所有者ロールまたはWITH GRANT OPTION権限を持つロールによって付与されたものとして記録されます。 例えば、テーブルt1がロールg1によって所有され、ロールu1がロールg1のメンバであるとします。 この場合、u1t1に関する権限をu2に付与できます。 しかし、これらの権限はg1によって直接付与されたものとして現れます。 後でロールg1の他のメンバがこの権限を取り消すことができます。

If the role executing <command>GRANT</command> holds the required privileges indirectly via more than one role membership path, it is unspecified which containing role will be recorded as having done the grant. In such cases it is best practice to use <command>SET ROLE</command> to become the specific role you want to do the <command>GRANT</command> as. GRANTを実行したロールが、ロールの持つ複数メンバ資格の経路を通して間接的に必要な権限を持つ場合、 どのロールが権限を付与したロールとして記録されるかについては指定されません。 こうした場合、SET ROLEを使用して、GRANTを行わせたい特定のロールになることを推奨します。

Granting permission on a table does not automatically extend permissions to any sequences used by the table, including sequences tied to <type>SERIAL</type> columns. Permissions on sequences must be set separately. テーブルへの権限付与によって、SERIAL列によって関連付けされたシーケンスを含め、そのテーブルで使用されるシーケンスへの権限の拡張は自動的に行われません。 シーケンスへの権限は別途設定しなければなりません。

See <xref linkend="ddl-priv"/> for more information about specific privilege types, as well as how to inspect objects' privileges. 特定の権限の種類に関するより詳しい情報や、対象の権限を調査する方法は5.7を参照してください。

<title>Examples</title>

Grant insert privilege to all users on table <literal>films</literal>: テーブルfilmsにデータを追加する権限を全てのユーザに与えます。

GRANT INSERT ON films TO PUBLIC;

Grant all available privileges to user <literal>manuel</literal> on view <literal>kinds</literal>: ビューkindsにおける利用可能な全ての権限を、ユーザmanuelに与えます。

GRANT ALL PRIVILEGES ON kinds TO manuel;

Note that while the above will indeed grant all privileges if executed by a superuser or the owner of <literal>kinds</literal>, when executed by someone else it will only grant those permissions for which the someone else has grant options. 上のコマンドをスーパーユーザやkindsの所有者が実行した場合は、全ての権限が付与されますが、他のユーザが実行した場合は、そのユーザがグラントオプションを持つ権限のみが付与されることに注意してください。

Grant membership in role <literal>admins</literal> to user <literal>joe</literal>: ロールadmins内のメンバ資格をユーザjoeに与えます。

GRANT admins TO joe;

互換性

<title>Compatibility</title>

According to the SQL standard, the <literal>PRIVILEGES</literal> key word in <literal>ALL PRIVILEGES</literal> is required. The SQL standard does not support setting the privileges on more than one object per command. 標準SQLでは、ALL PRIVILEGES内のPRIVILEGESキーワードは必須です。 標準SQLでは、1つのコマンドで複数のオブジェクトに権限を設定することはサポートしていません。

<productname>PostgreSQL</productname> allows an object owner to revoke their own ordinary privileges: for example, a table owner can make the table read-only to themselves by revoking their own <literal>INSERT</literal>, <literal>UPDATE</literal>, <literal>DELETE</literal>, and <literal>TRUNCATE</literal> privileges. This is not possible according to the SQL standard. The reason is that <productname>PostgreSQL</productname> treats the owner's privileges as having been granted by the owner to themselves; therefore they can revoke them too. In the SQL standard, the owner's privileges are granted by an assumed entity <quote>_SYSTEM</quote>. Not being <quote>_SYSTEM</quote>, the owner cannot revoke these rights. PostgreSQLでは、オブジェクトの所有者は、自身が持つ権限を取り消すことができます。 例えば、テーブル所有者は自身のINSERTUPDATEDELETETRUNCATE権限を取り消すことで、自分にとってそのテーブルが読み取り専用になるよう変更することができます。 これは、標準SQLでは不可能です。 PostgreSQLでは、所有者の権限を、所有者自身により与えられたものとして扱っているため、同様に所有者自身で権限を取り消すことができるようになっています。 標準SQLでは、所有者の権限は仮想的なエンティティ_SYSTEMによって与えられたものとして扱っています。 所有者は_SYSTEMではないため、その権限を取り消すことができません。

According to the SQL standard, grant options can be granted to <literal>PUBLIC</literal>; PostgreSQL only supports granting grant options to roles. 標準SQLにしたがうと、グラントオプションはPUBLICに対して与えることができます。 PostgreSQLではグラントオプションはロールに対して与えることのみをサポートしています。

The SQL standard allows the <literal>GRANTED BY</literal> option to specify only <literal>CURRENT_USER</literal> or <literal>CURRENT_ROLE</literal>. The other variants are PostgreSQL extensions. 標準SQLでは、GRANTED BYオプションに指定できるのはCURRENT_USERCURRENT_ROLEだけです。 その他のものはPostgreSQLの拡張です。

The SQL standard provides for a <literal>USAGE</literal> privilege on other kinds of objects: character sets, collations, translations. 標準SQLでは、文字セット、照合順序、翻訳といったその他の種類のオブジェクトに対して、USAGE権限を付与することができます。

In the SQL standard, sequences only have a <literal>USAGE</literal> privilege, which controls the use of the <literal>NEXT VALUE FOR</literal> expression, which is equivalent to the function <function>nextval</function> in PostgreSQL. The sequence privileges <literal>SELECT</literal> and <literal>UPDATE</literal> are PostgreSQL extensions. The application of the sequence <literal>USAGE</literal> privilege to the <literal>currval</literal> function is also a PostgreSQL extension (as is the function itself). 標準SQLでは、シーケンスはUSAGE権限のみを持ちます。 これはPostgreSQLにおけるnextval関数と等価なNEXT VALUE FOR式の使用を制御するものです。 シーケンスに関するSELECT権限とUPDATE権限はPostgreSQLの拡張です。 シーケンスに関するUSAGE権限がcurrval関数にも適用される点もPostgreSQLの拡張です(この関数自体が拡張です)。

Privileges on databases, tablespaces, schemas, languages, and configuration parameters are <productname>PostgreSQL</productname> extensions. データベース、テーブル空間、スキーマ、言語、設定パラメータについての権限はPostgreSQLの拡張です。

関連項目

<title>See Also</title> REVOKE, ALTER DEFAULT PRIVILEGES