
## Synopsis

Use the CREATE OPERATOR statement to create an operator.

## Syntax

{{%ebnf%}}
  create_operator,
  operator_option
{{%/ebnf%}}

## Semantics

See the semantics of each option in the [PostgreSQL documentation][postgresql-docs-create-operator].

## Examples

Basic example.

```plpgsql
yugabyte=# CREATE OPERATOR @#@ (
             rightarg = int8,
             procedure = numeric_fac
           );
yugabyte=# SELECT @#@ 5;
```

```output
 ?column?
----------
      120
```

## See also

- [DROP OPERATOR](../ddl_drop_operator)

[postgresql-docs-create-operator]: https://www.postgresql.org/docs/15/sql-createoperator.html
