CREATE OPERATOR CLASS

Synopsis

Use the CREATE OPERATOR CLASS statement to create a new operator class.

Syntax

  1. create_operator_class ::= CREATE OPERATOR CLASS operator_class_name
  2. [ DEFAULT ] FOR TYPE data_type USING
  3. index_method AS operator_class_as [ , ... ]
  4. operator_class_as ::= OPERATOR strategy_number operator_name
  5. [ ( operator_signature ) ] [ FOR SEARCH ]
  6. | FUNCTION support_number
  7. [ ( op_type [ , ... ] ) ] function_name (
  8. function_signature )
  9. | STORAGE storage_type

create_operator_class

CREATE OPERATOR CLASS - 图1

operator_class_as

CREATE OPERATOR CLASS - 图2

Semantics

See the semantics of each option in the [PostgreSQL docs][postgresql-docs-create-op-class]. See thesemantics of strategy_number and support_number in another page of the [PostgreSQLdocs][postgresql-docs-xindex].

Examples

Basic example.

  1. yugabyte=# CREATE OPERATOR CLASS my_op_class
  2. FOR TYPE int4
  3. USING btree AS
  4. OPERATOR 1 <,
  5. OPERATOR 2 <=;

See also