第二章 SQL命令参考-ALTER FUNCTION
来源:互联网 发布:外企 工作 知乎 编辑:程序博客网 时间:2024/05/12 15:34
ALTER FUNCTION
更改函数的定义。
概要
ALTERFUNCTION name ( [ [argmode] [argname] argtype [,...] ] )
action [, ... ] [RESTRICT]
ALTERFUNCTION name ( [ [argmode] [argname] argtype [,...] ] )
RENAMETO new_name
ALTERFUNCTION name ( [ [argmode] [argname] argtype [,...] ] )
OWNERTO new_owner
ALTERFUNCTION name ( [ [argmode] [argname] argtype [,...] ] )
SETSCHEMA new_schema
where actionis one of:
{CALLEDON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT}
{IMMUTABLE| STABLE | VOLATILE}
{[EXTERNAL]SECURITY INVOKER | [EXTERNAL] SECURITY DEFINER}
描述
ALTER FUNCTION更改函数的定义。
你必须拥有这个函数才能去更改函数的定义。要更改函数的模式,您还必须对新模式具有CREATE权限。要更改所有者,您还必须是新拥有角色的直接或间接成员,并且该角色必须对该函数的模式具有CREATE权限。(这些限制强制改变所有者不会通过删除和重新创建功能来做任何事情,但超级用户可以改变任何功能的所有权。)
parameter
name
现有函数的名称(可以带schema前缀)
argmode
IN,OUT或INOUT。如果省略,默认值为IN。请注意,ALTERFUNCTION实际上并不关注OUT参数,因为只需要输入参数来确定函数的身份。所以列出IN和INOUT参数就足够了。
argname
参数的名称。请注意,ALTERFUNCTION实际上并不关心参数名称,因为只需要参数数据类型来确定函数的身份。
argtype
函数的参数的数据类型为3(可选模式限定),如果有的话.
new_name
函数的新名称.
new_owner
函数的新的属主。请注意,如果该功能标记为“安全定义器”,它将随后作为新的所有者执行。
new_schema
函数的新的schema.
CALLED ON NULL INPUT RETURNS NULL ON NULLINPUT STRICT
called on nullinputchanges thefunction so that it will be invoked when some or all of its arguments are null.returns null on null input orstrictchanges the function so that it is notinvoked if any of its arguments are null; instead, a null result is assumedautomatically. Seecreate functionfor more information.
IMMUTABLE
STABLE
VOLATILE
Change the volatility of the function tothe specified setting. Seecreate functionfor details.
[EXTERNAL ] SECURITY INVOKER [EXTERNAL ]SECURITY DEFINER
Change whether the function is a securitydefiner or not. The key wordexternalis ignored for SQL conformance. Seecreatefunctionfor moreinformation about this capability.
RESTRICT
Ignored forconformance with the SQL standard.
Notes
Greenplum Database has limitations on theuse of functions defined asstableorvolatile. Seecreate functionfor moreinformation.
示例
To rename thefunctionsqrtfor typeintegertosquare_root:
ALTER FUNCTIONsqrt(integer) RENAME TO square_root;
To change theowner of the functionsqrtfor typeintegertojoe:
ALTER FUNCTIONsqrt(integer) OWNER TO joe;
To change theschema of the functionsqrtfor typeintegertomath:
ALTER FUNCTIONsqrt(integer) SET SCHEMA math;
兼容性
This statement is partially compatiblewith thealter functionstatement in the SQL standard. The standard allows moreproperties of a function to be modified, but does not provide the ability torename a function, make a function a security definer, or change the owner,schema, or volatility of a function. The standard also requires therestrictkey word, which is optional inGreenplum Database.
相关参考
CREATE FUNCTION,DROP FUNCTION
- 第二章 SQL命令参考-ALTER FUNCTION
- 第二章 SQL命令参考-ALTER AGGREGATE
- 第二章 SQL命令参考-ALTER CONVERSION
- 第二章 SQL命令参考-ALTER DATABASE
- 第二章 SQL命令参考-ALTER FILESPACE
- 第二章 SQL命令参考-ALTER EXTERNAL TABLE
- 第二章 SQL命令参考-ABORT
- 第二章 SQL命令参考-ANALYZE
- 第二章 SQL命令参考-BEGIN
- 第二章 SQL参考命令-CHECKPOINT
- 第二章 SQL参考命令-CLOSE
- 第二章 SQL参考命令-CLUSTER
- 第二章 SQL参考命令-COMMENT
- 第二章 SQL命令参考-COPY
- 第二章 SQL命令参考-CREATE TABLESPACE
- 第二章 SQL命令参考-CREATE TYPE
- 第二章 SQL命令参考-CREATE VIEW
- 第二章 SQL命令参考-DECLARE
- Linux 命令 打包与压缩
- 汇编知识总结
- 注解
- zk中session的分桶管理策略
- Linux命令 管道
- 第二章 SQL命令参考-ALTER FUNCTION
- 基础运维8
- Linux命令 yum
- 利用JMeter进行Tomcat调优
- L1-008求整数段和
- Servlet与九大内置对象的关系
- Linux基础操作(三)
- CorelDRAW 发光字想制作的漂亮一些就得会这些技巧
- [转]安装python3的theano库的两种方法