ALTER ROUTINE — 更改例程的定义
ALTER ROUTINEname
[ ( [ [argmode
] [argname
]argtype
[, ...] ] ) ]action
[ ... ] [ RESTRICT ] ALTER ROUTINEname
[ ( [ [argmode
] [argname
]argtype
[, ...] ] ) ] RENAME TOnew_name
ALTER ROUTINEname
[ ( [ [argmode
] [argname
]argtype
[, ...] ] ) ] OWNER TO {new_owner
| CURRENT_ROLE | CURRENT_USER | SESSION_USER } ALTER ROUTINEname
[ ( [ [argmode
] [argname
]argtype
[, ...] ] ) ] SET SCHEMAnew_schema
ALTER ROUTINEname
[ ( [ [argmode
] [argname
]argtype
[, ...] ] ) ] [ NO ] DEPENDS ON EXTENSIONextension_name
whereaction
is one of: IMMUTABLE | STABLE | VOLATILE [ NOT ] LEAKPROOF [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER PARALLEL { UNSAFE | RESTRICTED | SAFE } COSTexecution_cost
ROWSresult_rows
SETconfiguration_parameter
{ TO | = } {value
| DEFAULT } SETconfiguration_parameter
FROM CURRENT RESETconfiguration_parameter
RESET ALL
ALTER ROUTINE
更改例程的定义,例程可以是聚合函数、普通函数或过程。请参阅 ALTER AGGREGATE、ALTER FUNCTION 和 ALTER PROCEDURE 下的内容,了解参数的描述、更多示例和进一步的详细信息。
将类型为 integer
的例程 foo
重命名为 foobar
ALTER ROUTINE foo(integer) RENAME TO foobar;
无论 foo
是聚合、函数还是过程,此命令都将起作用。
此语句与 SQL 标准中的 ALTER ROUTINE
语句部分兼容。请参阅 ALTER FUNCTION 和 ALTER PROCEDURE 下的内容,了解详细信息。允许例程名称引用聚合函数是 PostgreSQL 的扩展。