数据仓库服务 GAUSSDB(DWS)-ALTER FUNCTION:语法格式

时间:2024-12-06 15:12:40

语法格式

  • 修改自定义函数的附加参数:
    1
    2
    ALTER FUNCTION function_name ( [ { [ argmode ] [ argname ] argtype} [, ...] ] )
        action [ ... ] [ RESTRICT ];
    

    其中附加参数action子句语法为:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    {CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT}
     | {IMMUTABLE | STABLE | VOLATILE}
     | {SHIPPABLE | NOT SHIPPABLE}
     | {NOT FENCED | FENCED}
     | {MASKED | NOT MASKED}
     | [ NOT ] LEAKPROOF
     | { [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER }
     | AUTHID { DEFINER | CURRENT_USER }
     | COST execution_cost
     | ROWS result_rows
     | SET configuration_parameter { { TO | = } { value | DEFAULT }| FROM CURRENT}
     | RESET {configuration_parameter | ALL}
    
  • 修改自定义函数的名字,支持新函数名前带有原函数所在的schema名,不支持同时修改schema名:
    1
    2
    3
    4
    ALTER FUNCTION funname ( [ { [ argmode ] [ argname ] argtype} [, ...] ] )
        RENAME TO new_name;
    ALTER FUNCTION funname ( [ { [ argmode ] [ argname ] argtype} [, ...] ] )
        RENAME TO schema.new_name;
    
  • 修改自定义函数的所属者:
    1
    2
    ALTER FUNCTION funname ( [ { [ argmode ] [ argname ] argtype} [, ...] ] )
        OWNER TO new_owner;
    
  • 修改自定义函数的模式:
    1
    2
    ALTER FUNCTION funname ( [ { [ argmode ] [ argname ] argtype} [, ...] ] )
        SET SCHEMA new_schema;
    
support.huaweicloud.com/sqlreference-910-dws/dws_06_0126.html