blob: 1d2878e02eb98c235a14a50b76d60a7306fdf1f4 [file]
---
title: ALTER OPERATOR CLASS
---
Changes the definition of an operator class.
## <a id="synop"></a>Synopsis
``` sql
ALTER OPERATOR CLASS <name> USING <index_method> RENAME TO <newname>
ALTER OPERATOR CLASS <name> USING <index_method> OWNER TO <newowner>
```
## <a id="desc"></a>Description
`ALTER OPERATOR CLASS` changes the definition of an operator class
You must own the operator class to use `ALTER OPERATOR CLASS`. To alter the owner, you must also be a direct or indirect member of the new owning role, and that role must have `CREATE` privilege on the operator classs schema. (These restrictions enforce that altering the owner does not do anything you could not do by dropping and recreating the operator class. However, a superuser can alter ownership of any operator class anyway.)
## <a id="alteroperatorclass__section4"></a>Parameters
<dt> \<name\> </dt>
<dd>The name (optionally schema-qualified) of an existing operator class.</dd>
<dt> \<index\_method\> </dt>
<dd>The name of the index method this operator class is for.</dd>
<dt> \<newname\> </dt>
<dd>The new name of the operator class.</dd>
<dt> \<newowner\> </dt>
<dd>The new owner of the operator class</dd>
## <a id="compat"></a>Compatibility
There is no `ALTER OPERATOR` statement in the SQL standard.
## <a id="see"></a>See Also
[CREATE OPERATOR](CREATE-OPERATOR.html), [DROP OPERATOR CLASS](DROP-OPERATOR-CLASS.html)