CREATE OPERATOR
Synopsis
Use the CREATE OPERATOR
statement to create an operator.
Syntax
create_operator ::= CREATE OPERATOR operator_name (
{ FUNCTION = function_name
| PROCEDURE = procedure_name }
[ , operator_option [ ... ] ] )
operator_option ::= LEFTARG = left_type
| RIGHTARG = right_type
| COMMUTATOR = com_op
| NEGATOR = neg_op
| RESTRICT = res_proc
| JOIN = join_proc
| HASHES
| MERGES
create_operator
operator_option
Semantics
See the semantics of each option in the [PostgreSQL docs][postgresql-docs-create-operator].
Examples
Basic example.
yugabyte=# CREATE OPERATOR @#@ (
rightarg = int8,
procedure = numeric_fac
);
yugabyte=# SELECT @#@ 5;
?column?
----------
120