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

ALTER FOREIGN DATA WRAPPER

ALTER FOREIGN DATA WRAPPER <refpurpose>change the definition of a foreign-data wrapper</refpurpose> — 外部データラッパーの定義を変更する

概要

ALTER FOREIGN DATA WRAPPER name
    [ HANDLER handler_function | NO HANDLER ]
    [ VALIDATOR validator_function | NO VALIDATOR ]
    [ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ]) ]
ALTER FOREIGN DATA WRAPPER name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER FOREIGN DATA WRAPPER name RENAME TO new_name

説明

<title>Description</title>

<command>ALTER FOREIGN DATA WRAPPER</command> changes the definition of a foreign-data wrapper. The first form of the command changes the support functions or the generic options of the foreign-data wrapper (at least one clause is required). The second form changes the owner of the foreign-data wrapper. ALTER FOREIGN DATA WRAPPERは外部データラッパーの定義を変更します。 このコマンドの第1の構文はサポート関数または外部データラッパーの一般的なオプションを変更します。 (少なくとも1つの句が必要です。) 第2の構文は外部データラッパーの所有者を変更します。

Only superusers can alter foreign-data wrappers. Additionally, only superusers can own foreign-data wrappers. スーパーユーザのみが外部データラッパーを変更することができます。 さらにスーパーユーザのみが外部データラッパーを所有することができます。

パラメータ

<title>Parameters</title>
name

The name of an existing foreign-data wrapper. 既存の外部データラッパーの名前です。

HANDLER handler_function

Specifies a new handler function for the foreign-data wrapper. 外部データラッパー用の新しいハンドラ関数を指定します。

NO HANDLER

This is used to specify that the foreign-data wrapper should no longer have a handler function. これを使用して外部データラッパーがハンドラ関数を持たないことを指定します。

Note that foreign tables that use a foreign-data wrapper with no handler cannot be accessed. ハンドラを持たない外部データラッパーを使用する外部テーブルにはアクセスできないことに注意してください。

VALIDATOR validator_function

Specifies a new validator function for the foreign-data wrapper. 外部データラッパー用の新しい検証関数を指定します。

Note that it is possible that pre-existing options of the foreign-data wrapper, or of dependent servers, user mappings, or foreign tables, are invalid according to the new validator. <productname>PostgreSQL</productname> does not check for this. It is up to the user to make sure that these options are correct before using the modified foreign-data wrapper. However, any options specified in this <command>ALTER FOREIGN DATA WRAPPER</command> command will be checked using the new validator. 外部データラッパーや依存するサーバ、ユーザマップ、外部テーブルの既存のオプションが新しい検証関数に対して無効となる可能性があることに注意してください。 PostgreSQLはこの検査を行いません。 変更された外部データラッパーを使用する前にこれらのオプションが正しいことを確実にすることはユーザの責任です。 しかしこのALTER FOREIGN DATA WRAPPERコマンドで指定されたオプションはすべて新しい検証関数で検査されます。

NO VALIDATOR

This is used to specify that the foreign-data wrapper should no longer have a validator function. これは、外部データラッパーが検証関数を持たないことを指定するために使用されます。

OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )

Change options for the foreign-data wrapper. <literal>ADD</literal>, <literal>SET</literal>, and <literal>DROP</literal> specify the action to be performed. <literal>ADD</literal> is assumed if no operation is explicitly specified. Option names must be unique; names and values are also validated using the foreign data wrapper's validator function, if any. 外部データラッパー用のオプションを変更します。 ADDSETDROPは実行する動作を指定します。 明示的な動作の指定がなければADDとみなされます。 オプション名は一意でなければなりません。 また名前と値は外部データラッパーの検証関数を使用して検証されます。

new_owner

The user name of the new owner of the foreign-data wrapper. 外部データラッパーの新しい所有者のユーザ名です。

new_name

The new name for the foreign-data wrapper. 外部データラッパーの新しい名前です。

<title>Examples</title>

Change a foreign-data wrapper <literal>dbi</literal>, add option <literal>foo</literal>, drop <literal>bar</literal>: 外部データラッパーdbiを変更し、fooオプションを追加し、barオプションを削除します。

ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo '1', DROP 'bar');

Change the foreign-data wrapper <literal>dbi</literal> validator to <literal>bob.myvalidator</literal>: 外部データラッパーdbiの検証関数をbob.myvalidatorに変更します。

ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob.myvalidator;

互換性

<title>Compatibility</title>

<command>ALTER FOREIGN DATA WRAPPER</command> conforms to ISO/IEC 9075-9 (SQL/MED), except that the <literal>HANDLER</literal>, <literal>VALIDATOR</literal>, <literal>OWNER TO</literal>, and <literal>RENAME</literal> clauses are extensions. ALTER FOREIGN DATA WRAPPERはISO/IEC 9075-9 (SQL/MED)に従います。 ただし、 HANDLERVALIDATOROWNER TORENAME句は拡張です。

関連項目

<title>See Also</title> CREATE FOREIGN DATA WRAPPER, DROP FOREIGN DATA WRAPPER