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

DROP OPERATOR CLASS

DROP OPERATOR CLASS <refpurpose>remove an operator class</refpurpose> — 演算子クラスを削除する

概要

DROP OPERATOR CLASS [ IF EXISTS ] name USING index_method [ CASCADE | RESTRICT ]

説明

<title>Description</title>

<command>DROP OPERATOR CLASS</command> drops an existing operator class. To execute this command you must be the owner of the operator class. DROP OPERATOR CLASSは既存の演算子クラスを削除します。 このコマンドを実行するには、演算子クラスの所有者でなければなりません。

<command>DROP OPERATOR CLASS</command> does not drop any of the operators or functions referenced by the class. If there are any indexes depending on the operator class, you will need to specify <literal>CASCADE</literal> for the drop to complete. DROP OPERATOR CLASSはそのクラスで参照される演算子や関数をまったく削除しません。 演算子クラスに依存するインデックスがある場合、削除を成功させるためにはCASCADEを指定する必要があります。

パラメータ

<title>Parameters</title>
IF EXISTS

Do not throw an error if the operator class does not exist. A notice is issued in this case. 演算子クラスが存在しない場合でもエラーになりません。 この場合注意メッセージが発行されます。

name

The name (optionally schema-qualified) of an existing operator class. 既存の演算子クラスの名前です(スキーマ修飾名も可)。

index_method

The name of the index access method the operator class is for. この演算子クラスを使用するインデックスアクセスメソッドの名前です。

CASCADE

Automatically drop objects that depend on the operator class (such as indexes), and in turn all objects that depend on those objects (see <xref linkend="ddl-depend"/>). この演算子クラスに依存しているオブジェクト(インデックスなど)を自動的に削除し、さらにそれらのオブジェクトに依存するすべてのオブジェクトも削除します (5.14参照)。

RESTRICT

Refuse to drop the operator class if any objects depend on it. This is the default. 依存しているオブジェクトがある場合に、その演算子クラスの削除を拒否します。 こちらがデフォルトです。

注釈

<title>Notes</title>

<command>DROP OPERATOR CLASS</command> will not drop the operator family containing the class, even if there is nothing else left in the family (in particular, in the case where the family was implicitly created by <command>CREATE OPERATOR CLASS</command>). An empty operator family is harmless, but for the sake of tidiness you might wish to remove the family with <command>DROP OPERATOR FAMILY</command>; or perhaps better, use <command>DROP OPERATOR FAMILY</command> in the first place. DROP OPERATOR CLASSは、そのクラスを含む演算子族を削除しません。 たとえその演算子族が空になったとしても(特にその演算子族がCREATE OPERATOR CLASSで暗黙的に作成された場合でも)です。 空の演算子族は存在しても害はありませんが、整理するためにDROP OPERATOR FAMILYを使用してこの演算子族を削除することができます。 あるいは最初にDROP OPERATOR FAMILYを使って下さい。

<title>Examples</title>

Remove the B-tree operator class <literal>widget_ops</literal>: widget_opsという名前のB-tree演算子クラスを削除します。

DROP OPERATOR CLASS widget_ops USING btree;

This command will not succeed if there are any existing indexes that use the operator class. Add <literal>CASCADE</literal> to drop such indexes along with the operator class. 演算子クラスを使用するインデックスが存在する場合、このコマンドは実行できません。 このようなインデックスを演算子クラスとともに削除するには、CASCADEを指定します。

互換性

<title>Compatibility</title>

There is no <command>DROP OPERATOR CLASS</command> statement in the SQL standard. 標準SQLにはDROP OPERATOR CLASSは存在しません。

関連項目

<title>See Also</title> ALTER OPERATOR CLASS, CREATE OPERATOR CLASS, DROP OPERATOR FAMILY