ALTER OPERATOR <refpurpose>change the definition of an operator</refpurpose> — 演算子の定義を変更する
ALTER OPERATORname
( {left_type
| NONE } ,right_type
) OWNER TO {new_owner
| CURRENT_ROLE | CURRENT_USER | SESSION_USER } ALTER OPERATORname
( {left_type
| NONE } ,right_type
) SET SCHEMAnew_schema
ALTER OPERATORname
( {left_type
| NONE } ,right_type
) SET ( { RESTRICT = {res_proc
| NONE } | JOIN = {join_proc
| NONE } } [, ... ] )
<command>ALTER OPERATOR</command> changes the definition of
an operator.
ALTER OPERATOR
は演算子の定義を変更します。
You must own the operator to use <command>ALTER OPERATOR</command>.
To alter the owner, you must be able to <literal>SET ROLE</literal> to the
new owning role, and that role must have <literal>CREATE</literal>
privilege on the operator's schema.
(These restrictions enforce that altering the owner
doesn't do anything you couldn't do by dropping and recreating the operator.
However, a superuser can alter ownership of any operator anyway.)
ALTER OPERATOR
を使用するには演算子の所有者でなければなりません。
所有者を変更するには、新しい所有者ロールに対してSET ROLE
ができなければなりません。また、そのロールは演算子のスキーマにおいてCREATE
権限を持たなければなりません。
(この制限により、演算子の削除と再作成で行うことができない処理を所有者の変更で行えないようになります。
しかし、スーパーユーザはすべての演算子の所有者を変更することができます。)
name
The name (optionally schema-qualified) of an existing operator. 既存の演算子の名前です(スキーマ修飾名も可)。
left_type
The data type of the operator's left operand; write
<literal>NONE</literal> if the operator has no left operand.
演算子の左オペランドのデータ型です。
左オペランドがない演算子の場合はNONE
を指定します。
right_type
The data type of the operator's right operand. 演算子の右オペランドのデータ型です。
new_owner
The new owner of the operator. 演算子の新しい所有者です。
new_schema
The new schema for the operator. 演算子の新しいスキーマです。
res_proc
The restriction selectivity estimator function for this operator; write NONE to remove existing selectivity estimator. この演算子の制約選択評価関数です。 既存の制約選択評価関数を削除するにはNONEを指定します。
join_proc
The join selectivity estimator function for this operator; write NONE to remove existing selectivity estimator. この演算子の結合選択評価関数です。 既存の結合選択評価関数を削除するにはNONEを指定します。
Change the owner of a custom operator <literal>a @@ b</literal> for type <type>text</type>:
text
型用の独自の演算子a @@ b
の所有者を変更します。
ALTER OPERATOR @@ (text, text) OWNER TO joe;
Change the restriction and join selectivity estimator functions of a custom operator <literal>a && b</literal> for type <type>int[]</type>:
int[]
型用の独自の演算子a && b
の制約および結合選択評価関数を変更します。
ALTER OPERATOR && (_int4, _int4) SET (RESTRICT = _int_contsel, JOIN = _int_contjoinsel);
There is no <command>ALTER OPERATOR</command> statement in
the SQL standard.
標準SQLにはALTER OPERATOR
文はありません。