Postgresql 中文操作指南
Description
DROP OPERATOR CLASS 删除现有的操作类别。若要执行此命令,您必须是操作类别的所有者。
DROP OPERATOR CLASS drops an existing operator class. To execute this command you must be the owner of the operator class.
DROP OPERATOR CLASS 不会删除任何由类别引用的操作员或函数。如果有任何索引依赖于操作类别,您需要指定 CASCADE 以完成删除操作。
DROP OPERATOR CLASS 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 CASCADE for the drop to complete.
Parameters
-
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 Section 5.14).
-
-
RESTRICT
-
Refuse to drop the operator class if any objects depend on it. This is the default.
-
Notes
DROP OPERATOR CLASS 不会删除包含该类别的操作员序列,即使序列中没有其他内容留存(特别是在序列由 CREATE OPERATOR CLASS 隐式创建的情况下)。空的操作员序列是无害的,但是为了整洁起见,您可能希望使用 DROP OPERATOR FAMILY 删除序列;或者在第一位就使用 DROP OPERATOR FAMILY 可能更好。
DROP OPERATOR CLASS 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 CREATE OPERATOR CLASS). An empty operator family is harmless, but for the sake of tidiness you might wish to remove the family with DROP OPERATOR FAMILY; or perhaps better, use DROP OPERATOR FAMILY in the first place.
Examples
删除 B 树操作类别 widget_ops :
Remove the B-tree operator class widget_ops:
DROP OPERATOR CLASS widget_ops USING btree;
如果使用操作类别的任何现有索引,此命令将不会成功。添加 CASCADE 来删除该类别的索引和操作类别。
This command will not succeed if there are any existing indexes that use the operator class. Add CASCADE to drop such indexes along with the operator class.