All Products
Search
Document Center

PolarDB:ALTER OPERATOR CLASS

Last Updated:Mar 28, 2026

Modifies the definition of an operator class.

Description

To use ALTER OPERATOR CLASS, you must own the operator class. To change the owner, you must be a direct or indirect member of the new owning role, and that role must have CREATE privilege on the operator class's schema. These restrictions ensure that changing the owner produces no effects beyond what dropping and recreating the operator class would produce. A superuser can alter the ownership of any operator class regardless of these requirements.

Synopsis

ALTER OPERATOR CLASS name USING index_method
    RENAME TO new_name

ALTER OPERATOR CLASS name USING index_method
    OWNER TO { new_owner | CURRENT_USER | SESSION_USER }

ALTER OPERATOR CLASS name USING index_method
    SET SCHEMA new_schema

Parameters

ParameterDescription
nameThe name of an existing operator class, optionally schema-qualified.
index_methodThe name of the index method the operator class is for.
new_nameThe new name for the operator class.
new_ownerThe new owner of the operator class.
new_schemaThe new schema for the operator class.

Compatibility

There is no ALTER OPERATOR CLASS statement in the SQL standard.

What's next