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

DROP OWNED

DROP OWNED <refpurpose>remove database objects owned by a database role</refpurpose> — データベースロールにより所有されるデータベースオブジェクトを削除します。

概要

DROP OWNED BY { name | CURRENT_ROLE | CURRENT_USER | SESSION_USER } [, ...] [ CASCADE | RESTRICT ]

説明

<title>Description</title>

<command>DROP OWNED</command> drops all the objects within the current database that are owned by one of the specified roles. Any privileges granted to the given roles on objects in the current database or on shared objects (databases, tablespaces, configuration parameters) will also be revoked. DROP OWNEDは、現在のデータベース内にある、指定したロールが所有するオブジェクトをすべて削除します。 また、現在のデータベース内にあるオブジェクトや共有オブジェクト(データベース、テーブル空間、構成パラメータ)に対して指定したロールに与えられた権限も取り消されます。

パラメータ

<title>Parameters</title>
name

The name of a role whose objects will be dropped, and whose privileges will be revoked. 所有するオブジェクトを削除し、その権限が取り消されるロールの名称です。

CASCADE

Automatically drop objects that depend on the affected objects, and in turn all objects that depend on those objects (see <xref linkend="ddl-depend"/>). 関連するオブジェクトに依存するオブジェクトを自動的に削除し、さらにそれらのオブジェクトに依存するすべてのオブジェクトも削除します(5.14参照)。

RESTRICT

Refuse to drop the objects owned by a role if any other database objects depend on one of the affected objects. This is the default. 他のデータベースオブジェクトが関連オブジェクトに依存する場合、ロールにより所有されるオブジェクトの削除を取りやめます。 これがデフォルトです。

注釈

<title>Notes</title>

<command>DROP OWNED</command> is often used to prepare for the removal of one or more roles. Because <command>DROP OWNED</command> only affects the objects in the current database, it is usually necessary to execute this command in each database that contains objects owned by a role that is to be removed. DROP OWNEDはよく、複数ロールの削除の前処理として使用されます。 DROP OWNEDは現在のデータベース内のオブジェクトにのみ影響しますので、このコマンドを通常、削除予定のロールが所有するオブジェクトを持つデータベース毎に実行する必要があります。

Using the <literal>CASCADE</literal> option might make the command recurse to objects owned by other users. CASCADEオプションを使用すると、このコマンドで再帰的に他のユーザが所有するオブジェクトを処理する可能性があります。

The <link linkend="sql-reassign-owned"><command>REASSIGN OWNED</command></link> command is an alternative that reassigns the ownership of all the database objects owned by one or more roles. However, <command>REASSIGN OWNED</command> does not deal with privileges for other objects. 代わりにREASSIGN OWNEDコマンドを使い、1つまたは複数のロールが所有するすべてのデータベースオブジェクトの所有権を再割り当てすることもできます。 ただしREASSIGN OWNEDは他のオブジェクトの権限については処理しません。

Databases and tablespaces owned by the role(s) will not be removed. ロールにより所有されるデータベースおよびテーブル空間は削除されません。

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

互換性

<title>Compatibility</title>

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

関連項目

<title>See Also</title> REASSIGN OWNED, DROP ROLE