ALTER FOREIGN DATA WRAPPER

From PostgreSQL wiki

(Difference between revisions)
Jump to: navigation, search
(示例)
(描述)
Line 13: Line 13:
 
=====描述=====
 
=====描述=====
  
ALTER FOREIGN DATA WRAPPER 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 改变外部数据封装的定义。第一种形式的命令修改外部数据封装的支撑函数或通用选项(至少需要一个子句)。第二种形式的命令修改外部数据封装的所有者。
  
Only superusers can alter foreign-data wrappers. Additionally, only superusers can own foreign-data wrappers.
+
只有超级用户才能更改外部数据封装。甚至,只有超级用户才能拥有外部数据封装。
  
 
=====参数=====
 
=====参数=====

Revision as of 15:23, 13 June 2013

Contents

名字

ALTER FOREIGN DATA WRAPPER -- 修改一个外部数据封装的定义

语法概要
   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
描述

ALTER FOREIGN DATA WRAPPER 改变外部数据封装的定义。第一种形式的命令修改外部数据封装的支撑函数或通用选项(至少需要一个子句)。第二种形式的命令修改外部数据封装的所有者。

只有超级用户才能更改外部数据封装。甚至,只有超级用户才能拥有外部数据封装。

参数
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 after changing the validator the options to the foreign-data wrapper, servers, and user mappings have become invalid. It is up to the user to make sure that these options are correct before using the 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. ADD, SET, and DROP specify the action to be performed. ADD 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.
示例

Change a foreign-data wrapper dbi, add option foo, drop bar:

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

Change the foreign-data wrapper dbi validator to bob.myvalidator:

   ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob.myvalidator;
兼容性

除了HANDLER, VALIDATOR 和 OWNER TO 子句是PostgreSQL扩展之外,ALTER FOREIGN DATA WRAPPER 符合 ISO/IEC 9075-9 (SQL/MED) 标准。

参见

CREATE FOREIGN DATA WRAPPER, DROP FOREIGN DATA WRAPPER

Personal tools