バージョンごとのドキュメント一覧

ALTER OPERATOR

ALTER OPERATOR <refpurpose>change the definition of an operator</refpurpose> — 演算子の定義を変更する

概要

ALTER OPERATOR name ( { left_type | NONE } , right_type )
    OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }

ALTER OPERATOR name ( { left_type | NONE } , right_type )
    SET SCHEMA new_schema

ALTER OPERATOR name ( { left_type | NONE } , right_type )
    SET ( {  RESTRICT = { res_proc | NONE }
           | JOIN = { join_proc | NONE }
         } [, ... ] )

説明

<title>Description</title>

<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権限を持たなければなりません。 (この制限により、演算子の削除と再作成で行うことができない処理を所有者の変更で行えないようになります。 しかし、スーパーユーザはすべての演算子の所有者を変更することができます。)

パラメータ

<title>Parameters</title>
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を指定します。

<title>Examples</title>

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 &amp;&amp; b</literal> for type <type>int[]</type>: int[]型用の独自の演算子a && bの制約および結合選択評価関数を変更します。

ALTER OPERATOR && (_int4, _int4) SET (RESTRICT = _int_contsel, JOIN = _int_contjoinsel);

互換性

<title>Compatibility</title>

There is no <command>ALTER OPERATOR</command> statement in the SQL standard. 標準SQLにはALTER OPERATOR文はありません。

関連項目

<title>See Also</title> CREATE OPERATOR, DROP OPERATOR