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的扩展。
如果您在文档中发现任何不正确的内容、与您对特定功能的体验不符的内容或需要进一步澄清的内容,请使用此表单报告文档问题。