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

ALTER EXTENSION

ALTER EXTENSION — change the definition of an extension 拡張の定義を変更する

概要

ALTER EXTENSION name UPDATE [ TO new_version ]
ALTER EXTENSION name SET SCHEMA new_schema
ALTER EXTENSION name ADD member_object
ALTER EXTENSION name DROP member_object


<phrase>where <replaceable class="parameter">member_object</replaceable> is:</phrase>

ここでmember_objectは以下の通りです。

  ACCESS METHOD object_name |
  AGGREGATE aggregate_name ( aggregate_signature ) |
  CAST (source_type AS target_type) |
  COLLATION object_name |
  CONVERSION object_name |
  DOMAIN object_name |
  EVENT TRIGGER object_name |
  FOREIGN DATA WRAPPER object_name |
  FOREIGN TABLE object_name |
  FUNCTION function_name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] |
  MATERIALIZED VIEW object_name |
  OPERATOR operator_name (left_type, right_type) |
  OPERATOR CLASS object_name USING index_method |
  OPERATOR FAMILY object_name USING index_method |
  [ PROCEDURAL ] LANGUAGE object_name |
  PROCEDURE procedure_name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] |
  ROUTINE routine_name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] |
  SCHEMA object_name |
  SEQUENCE object_name |
  SERVER object_name |
  TABLE object_name |
  TEXT SEARCH CONFIGURATION object_name |
  TEXT SEARCH DICTIONARY object_name |
  TEXT SEARCH PARSER object_name |
  TEXT SEARCH TEMPLATE object_name |
  TRANSFORM FOR type_name LANGUAGE lang_name |
  TYPE object_name |
  VIEW object_name


<phrase>and <replaceable>aggregate_signature</replaceable> is:</phrase>

またaggregate_signatureは以下の通りです。

* |
[ argmode ] [ argname ] argtype [ , ... ] |
[ [ argmode ] [ argname ] argtype [ , ... ] ] ORDER BY [ argmode ] [ argname ] argtype [ , ... ]

説明

<title>Description</title>

<command>ALTER EXTENSION</command> changes the definition of an installed extension. There are several subforms: ALTER EXTENSIONはインストールされた拡張の定義を変更します。 複数の副構文があります。

UPDATE

This form updates the extension to a newer version. The extension must supply a suitable update script (or series of scripts) that can modify the currently-installed version into the requested version. この構文は拡張を新しいバージョンに更新します。 拡張は、現在インストールされているバージョンから要求するバージョンに変更することができる、適切な更新スクリプト(またはスクリプト群)を提供しなければなりません。

SET SCHEMA

This form moves the extension's objects into another schema. The extension has to be <firstterm>relocatable</firstterm> for this command to succeed. この構文は拡張のオブジェクトを別のスキーマに移動します。 このコマンドを成功させるためには、拡張は再配置可能でなければなりません。

ADD member_object

This form adds an existing object to the extension. This is mainly useful in extension update scripts. The object will subsequently be treated as a member of the extension; notably, it can only be dropped by dropping the extension. この構文は既存のオブジェクトを拡張に追加します。 これは主に拡張の更新スクリプトで有用です。 オブジェクトはその後拡張のメンバとして扱われます。 特に、オブジェクトの削除は拡張の削除によってのみ可能です。

DROP member_object

This form removes a member object from the extension. This is mainly useful in extension update scripts. The object is not dropped, only disassociated from the extension. この構文は拡張からメンバオブジェクトを削除します。 これは主に拡張の更新スクリプトで有用です。 オブジェクトは削除されません。拡張との関連がなくなるだけです。

See <xref linkend="extend-extensions"/> for more information about these operations. これらの操作の詳細については38.17を参照してください。

You must own the extension to use <command>ALTER EXTENSION</command>. The <literal>ADD</literal>/<literal>DROP</literal> forms require ownership of the added/dropped object as well. ALTER EXTENSIONを使用するためには拡張の所有者でなければなりません。 ADD/DROP構文では追加されるオブジェクトまたは削除されるオブジェクトの所有者でもなければなりません。

パラメータ

<title>Parameters</title>

name

The name of an installed extension. インストールされた拡張の名前です。

new_version

The desired new version of the extension. This can be written as either an identifier or a string literal. If not specified, <command>ALTER EXTENSION UPDATE</command> attempts to update to whatever is shown as the default version in the extension's control file. 更新したい新しい拡張のバージョンです。 これは識別子または文字列リテラルのいずれかで記述することができます。 指定がない場合、ALTER EXTENSION UPDATEは拡張の制御ファイル内でデフォルトバージョンとして示されるものへの更新を試行します。

new_schema

The new schema for the extension. 拡張の新しいスキーマです。

object_name
aggregate_name
function_name
operator_name
procedure_name
routine_name

The name of an object to be added to or removed from the extension. Names of tables, aggregates, domains, foreign tables, functions, operators, operator classes, operator families, procedures, routines, sequences, text search objects, types, and views can be schema-qualified. 拡張に追加する、または、拡張から削除するオブジェクトの名前です。 テーブル、集約、ドメイン、外部テーブル、関数、演算子、演算子クラス、演算子族、プロシージャ、ルーチン、シーケンス、全文検索オブジェクト、型、ビューの名前はスキーマ修飾可能です。

source_type

The name of the source data type of the cast. キャストの変換元データ型の名前です。

target_type

The name of the target data type of the cast. キャストの変換先データ型の名前です。

argmode

The mode of a function, procedure, or aggregate argument: <literal>IN</literal>, <literal>OUT</literal>, <literal>INOUT</literal>, or <literal>VARIADIC</literal>. If omitted, the default is <literal>IN</literal>. Note that <command>ALTER EXTENSION</command> does not actually pay any attention to <literal>OUT</literal> arguments, since only the input arguments are needed to determine the function's identity. So it is sufficient to list the <literal>IN</literal>, <literal>INOUT</literal>, and <literal>VARIADIC</literal> arguments. 関数、プロシージャ、または集約の引数のモードでINOUTINOUTVARIADICのいずれかです。 省略時のデフォルトはINです。 関数を識別するためには入力引数だけが必要ですので、実際のところALTER EXTENSIONOUT引数を考慮しないことに注意してください。 このためININOUTおよびVARIADIC引数を列挙するだけで十分です。

argname

The name of a function, procedure, or aggregate argument. Note that <command>ALTER EXTENSION</command> does not actually pay any attention to argument names, since only the argument data types are needed to determine the function's identity. 関数、プロシージャ、または集約の引数の名前です。 関数を識別するためには入力引数だけが必要ですので、実際のところALTER EXTENSIONは引数名を考慮しないことに注意してください。

argtype

The data type of a function, procedure, or aggregate argument. 関数、プロシージャ、または集約の引数のデータ型です。

left_type
right_type

The data type(s) of the operator's arguments (optionally schema-qualified). Write <literal>NONE</literal> for the missing argument of a prefix operator. 演算子の引数のデータ型(スキーマ修飾可)です 前置演算子における存在しない引数にはNONEと記述してください。

PROCEDURAL

This is a noise word. これは無意味な単語です。

type_name

The name of the data type of the transform. 変換のデータ型の名前です。

lang_name

The name of the language of the transform. 変換の言語の名前です。

<title>Examples</title>

To update the <literal>hstore</literal> extension to version 2.0: hstore拡張をバージョン2.0に更新します。

ALTER EXTENSION hstore UPDATE TO '2.0';

To change the schema of the <literal>hstore</literal> extension to <literal>utils</literal>: hstore拡張のスキーマをutilsに変更します。

ALTER EXTENSION hstore SET SCHEMA utils;

To add an existing function to the <literal>hstore</literal> extension: hstore拡張に既存の関数を追加します。

ALTER EXTENSION hstore ADD FUNCTION populate_record(anyelement, hstore);

互換性

<title>Compatibility</title>

<command>ALTER EXTENSION</command> is a <productname>PostgreSQL</productname> extension. ALTER EXTENSIONPostgreSQLの拡張です。

関連項目

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