CREATE OPERATOR
Synopsis
Use the CREATE OPERATOR
statement to create a new 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?
?column?
120
See also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .