{"Entry":{"collection":"sql","key":"drop-operator-family","name":"DROP OPERATOR FAMILY","aliases":["dropopfamily"],"metadata":{"aliases":["dropopfamily"],"changed_in":[],"changes":[{"from":"8.2","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"added","synopsis":null,"to":"8.3"},{"from":"9.5","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"9.6"},{"from":"11","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"12"},{"from":"16","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"17"},{"from":"18","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"19"}],"content_hash":"e348565f8b54d51c0508e3340dbc12a73deefb54dfa22b6408f350b8f6a91960","editorial":{},"first_version":"8.3","group":"type","imported_at":"2026-09-30T17:43:37.603458+08:00","last_version":"20","name":"DROP OPERATOR FAMILY","object":"OPERATOR FAMILY","position":3019,"present_in":["8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"purpose":"remove an operator family","purpose_zh":"","related":["alter-operator-family","create-operator-family","alter-operator-class","create-operator-class","drop-operator-class"],"slug":"drop-operator-family","source_rev":"a709ab85","synopsis":"DROP OPERATOR FAMILY [ IF EXISTS ] name USING index_method [ CASCADE | RESTRICT ]","verb":"DROP"}},"Definition":{"Collection":"sql","Key":"drop-operator-family","SourceDatabase":"center","Version":"18","SourceTable":"sqlcmd","SourceKey":"drop-operator-family","SourceRevision":"a709ab85","Facts":{"anchor":"SQL-DROPOPFAMILY","file":"sql-dropopfamily.html","lang":"en","name":"DROP OPERATOR FAMILY","purpose":"remove an operator family","purpose_zh":"","related":["alter-operator-family","create-operator-family","alter-operator-class","create-operator-class","drop-operator-class"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eDROP OPERATOR FAMILY\u003c/code\u003e drops an existing operator family. To execute this command you must be the owner of the operator family.\u003c/p\u003e\u003cp\u003e\u003ccode class=\"command\"\u003eDROP OPERATOR FAMILY\u003c/code\u003e includes dropping any operator classes contained in the family, but it does not drop any of the operators or functions referenced by the family. If there are any indexes depending on operator classes within the family, you will need to specify \u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e for the drop to complete.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eDo not throw an error if the operator family does not exist. A notice is issued in this case.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name (optionally schema-qualified) of an existing operator family.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003eindex_method\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the index access method the operator family is for.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eAutomatically drop objects that depend on the operator family, and in turn all objects that depend on those objects (see \u003ca href=\"/docs/18/ddl-depend.html\" title=\"5.15. Dependency Tracking\"\u003eSection 5.15\u003c/a\u003e).\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eRefuse to drop the operator family if any objects depend on it. This is the default.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eRemove the B-tree operator family \u003ccode class=\"literal\"\u003efloat_ops\u003c/code\u003e:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eDROP OPERATOR FAMILY float_ops USING btree;\n\u003c/pre\u003e\u003cp\u003eThis command will not succeed if there are any existing indexes that use operator classes within the family. Add \u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e to drop such indexes along with the operator family.\u003c/p\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003eThere is no \u003ccode class=\"command\"\u003eDROP OPERATOR FAMILY\u003c/code\u003e statement in the SQL standard.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/alter-operator-family/?v=18\" title=\"ALTER OPERATOR FAMILY\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER OPERATOR FAMILY\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-operator-family/?v=18\" title=\"CREATE OPERATOR FAMILY\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE OPERATOR FAMILY\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/alter-operator-class/?v=18\" title=\"ALTER OPERATOR CLASS\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER OPERATOR CLASS\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-operator-class/?v=18\" title=\"CREATE OPERATOR CLASS\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE OPERATOR CLASS\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-operator-class/?v=18\" title=\"DROP OPERATOR CLASS\"\u003e\u003cspan class=\"refentrytitle\"\u003eDROP OPERATOR CLASS\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","slug":"18","synopsis_html":"DROP OPERATOR FAMILY [ IF EXISTS ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e USING \u003cem class=\"replaceable\"\u003e\u003ccode\u003eindex_method\u003c/code\u003e\u003c/em\u003e [ CASCADE | RESTRICT ]","synopsis_text":"DROP OPERATOR FAMILY [ IF EXISTS ] name USING index_method [ CASCADE | RESTRICT ]"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"drop-operator-family","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"DROP OPERATOR FAMILY","Summary":"移除一个操作符族","BodyHTML":"\u003cpre\u003eDROP OPERATOR FAMILY [ IF EXISTS ] name USING index_method [ CASCADE | RESTRICT ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eDROP OPERATOR FAMILY\u003c/code\u003e删除一个现有的操作符族。要执行此命令，你必须是该操作符族的拥有者。\u003c/p\u003e\u003cp\u003e\u003ccode\u003eDROP OPERATOR FAMILY\u003c/code\u003e还会删除该族中包含的所有操作符类，但不会删除该族引用的任何操作符或函数。如果有任何索引依赖于该族内的操作符类，你需要指定\u003ccode\u003eCASCADE\u003c/code\u003e才能完成删除。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e参数\u003c/h2\u003e\u003cdiv\u003e\u003cdl\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e如果该操作符族不存在，则不要抛出错误。这种情况下会发出一个提示。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e一个现有操作符族的名称（可以是模式限定的）。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003eindex_method\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e该操作符族所对应的索引访问方法名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eCASCADE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e自动删除依赖于该操作符族的对象，以及进一步依赖于这些对象的所有对象（参见\u003ca href=\"/docs/18/ddl-depend.html\" rel=\"nofollow\"\u003e第 5.15 节\u003c/a\u003e）。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e如果有任何对象依赖于该操作符族，则拒绝删除它。这是默认值。\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e示例\u003c/h2\u003e\u003cp\u003e移除 B-树操作符族\u003ccode\u003efloat_ops\u003c/code\u003e：\u003c/p\u003e\u003cpre\u003eDROP OPERATOR FAMILY float_ops USING btree;\n\u003c/pre\u003e\u003cp\u003e如果仍有索引使用该族内的操作符类，此命令将不会成功。加上\u003ccode\u003eCASCADE\u003c/code\u003e可以在删除操作符族的同时删除这类索引。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e兼容性\u003c/h2\u003e\u003cp\u003eSQL 标准中没有\u003ccode\u003eDROP OPERATOR FAMILY\u003c/code\u003e语句。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e另见\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/wiki/sql/alter-operator-family/?v=18\" title=\"ALTER OPERATOR FAMILY\" rel=\"nofollow\"\u003e\u003cspan\u003eALTER OPERATOR FAMILY\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-operator-family/?v=18\" title=\"CREATE OPERATOR FAMILY\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE OPERATOR FAMILY\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/alter-operator-class/?v=18\" title=\"ALTER OPERATOR CLASS\" rel=\"nofollow\"\u003e\u003cspan\u003eALTER OPERATOR CLASS\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-operator-class/?v=18\" title=\"CREATE OPERATOR CLASS\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE OPERATOR CLASS\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-operator-class/?v=18\" title=\"DROP OPERATOR CLASS\" rel=\"nofollow\"\u003e\u003cspan\u003eDROP OPERATOR CLASS\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","SourceRevision":"1b5ca64c","ContentHash":"407808346ff8785177372060ddb31186050b5f1af33b7ead3d973f47c116e33b","Payload":{"purpose_zh":"移除一个操作符族","sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eDROP OPERATOR FAMILY\u003c/code\u003e删除一个现有的操作符族。要执行此命令，你必须是该操作符族的拥有者。\u003c/p\u003e\u003cp\u003e\u003ccode class=\"command\"\u003eDROP OPERATOR FAMILY\u003c/code\u003e还会删除该族中包含的所有操作符类，但不会删除该族引用的任何操作符或函数。如果有任何索引依赖于该族内的操作符类，你需要指定\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e才能完成删除。\u003c/p\u003e","key":"description","title":"描述"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e如果该操作符族不存在，则不要抛出错误。这种情况下会发出一个提示。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e一个现有操作符族的名称（可以是模式限定的）。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003eindex_method\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e该操作符族所对应的索引访问方法名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e自动删除依赖于该操作符族的对象，以及进一步依赖于这些对象的所有对象（参见\u003ca href=\"/docs/18/ddl-depend.html\" title=\"5.15. 依赖跟踪\"\u003e第 5.15 节\u003c/a\u003e）。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e如果有任何对象依赖于该操作符族，则拒绝删除它。这是默认值。\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"参数"},{"html":"\u003cp\u003e移除 B-树操作符族\u003ccode class=\"literal\"\u003efloat_ops\u003c/code\u003e：\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eDROP OPERATOR FAMILY float_ops USING btree;\n\u003c/pre\u003e\u003cp\u003e如果仍有索引使用该族内的操作符类，此命令将不会成功。加上\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e可以在删除操作符族的同时删除这类索引。\u003c/p\u003e","key":"examples","title":"示例"},{"html":"\u003cp\u003eSQL 标准中没有\u003ccode class=\"command\"\u003eDROP OPERATOR FAMILY\u003c/code\u003e语句。\u003c/p\u003e","key":"compatibility","title":"兼容性"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/alter-operator-family/?v=18\" title=\"ALTER OPERATOR FAMILY\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER OPERATOR FAMILY\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-operator-family/?v=18\" title=\"CREATE OPERATOR FAMILY\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE OPERATOR FAMILY\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/alter-operator-class/?v=18\" title=\"ALTER OPERATOR CLASS\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER OPERATOR CLASS\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-operator-class/?v=18\" title=\"CREATE OPERATOR CLASS\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE OPERATOR CLASS\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-operator-class/?v=18\" title=\"DROP OPERATOR CLASS\"\u003e\u003cspan class=\"refentrytitle\"\u003eDROP OPERATOR CLASS\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"另见"}],"sections_same_as":"","synopsis_html":"DROP OPERATOR FAMILY [ IF EXISTS ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e USING \u003cem class=\"replaceable\"\u003e\u003ccode\u003eindex_method\u003c/code\u003e\u003c/em\u003e [ CASCADE | RESTRICT ]","synopsis_text":"DROP OPERATOR FAMILY [ IF EXISTS ] name USING index_method [ CASCADE | RESTRICT ]"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
