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

REASSIGN OWNED

REASSIGN OWNED <refpurpose>change the ownership of database objects owned by a database role</refpurpose> — あるデータベースロールにより所有されたデータベースオブジェクトの所有権を変更する

概要

REASSIGN OWNED BY { old_role | CURRENT_ROLE | CURRENT_USER | SESSION_USER } [, ...]
               TO { new_role | CURRENT_ROLE | CURRENT_USER | SESSION_USER }

説明

<title>Description</title>

<command>REASSIGN OWNED</command> instructs the system to change the ownership of database objects owned by any of the <replaceable class="parameter">old_roles</replaceable> to <replaceable class="parameter">new_role</replaceable>. REASSIGN OWNEDは、old_rolesのいずれかが所有するデータベースオブジェクトの所有権をnew_roleに変更するようシステムに指示します。

パラメータ

<title>Parameters</title>
old_role

The name of a role. The ownership of all the objects within the current database, and of all shared objects (databases, tablespaces), owned by this role will be reassigned to <replaceable class="parameter">new_role</replaceable>. ロール名です。 このロールが所有する、現在のデータベースのすべてのオブジェクトの所有権、および共有オブジェクトの中のすべて(データベースやテーブル空間)をnew_roleに割り当てます。

new_role

The name of the role that will be made the new owner of the affected objects. 対象とするオブジェクトの新しい所有者となるロール名です。

注釈

<title>Notes</title>

<command>REASSIGN OWNED</command> is often used to prepare for the removal of one or more roles. Because <command>REASSIGN OWNED</command> does not affect objects within other databases, it is usually necessary to execute this command in each database that contains objects owned by a role that is to be removed. REASSIGN OWNEDは、1つ以上のロールの削除準備によく使用されます。 REASSIGN OWNEDは他のデータベース内のオブジェクトには影響を与えませんので、通常は、削除対象のロールにより所有されるオブジェクトを有するデータベース毎にこのコマンドを実行する必要があります。

<command>REASSIGN OWNED</command> requires membership on both the source role(s) and the target role. REASSIGN OWNEDは元のロールと対象のロール上にメンバ資格が必要です。

The <link linkend="sql-drop-owned"><command>DROP OWNED</command></link> command is an alternative that simply drops all the database objects owned by one or more roles. 代わりにDROP OWNEDコマンドを使用して、1つ以上のロールにより所有されるデータベースオブジェクトすべてを単に削除することができます。

The <command>REASSIGN OWNED</command> command does not affect any privileges granted to the <replaceable class="parameter">old_roles</replaceable> on objects that are not owned by them. Likewise, it does not affect default privileges created with <command>ALTER DEFAULT PRIVILEGES</command>. Use <command>DROP OWNED</command> to revoke such privileges. REASSIGN OWNEDコマンドは、old_rolesにより所有されていないオブジェクトにおいてold_rolesに与えられた権限には影響しません。 同様に、ALTER DEFAULT PRIVILEGESで作成されたデフォルトの権限には影響しません。 こうした権限を取り消すには、DROP OWNEDを使用してください。

See <xref linkend="role-removal"/> for more discussion. 詳しくは22.4を参照してください。

互換性

<title>Compatibility</title>

The <command>REASSIGN OWNED</command> command is a <productname>PostgreSQL</productname> extension. REASSIGN OWNEDコマンドはPostgreSQLの拡張です。

関連項目

<title>See Also</title> DROP OWNED, DROP ROLE, ALTER DATABASE