Postgresql 中文操作指南

ALTER ROUTINE

ALTER ROUTINE — 更改例程的定义

Synopsis

ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    action [ ... ] [ RESTRICT ]
ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    RENAME TO new_name
ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    SET SCHEMA new_schema
ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    [ NO ] DEPENDS ON EXTENSION extension_name

where action is one of:

    IMMUTABLE | STABLE | VOLATILE
    [ NOT ] LEAKPROOF
    [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER
    PARALLEL { UNSAFE | RESTRICTED | SAFE }
    COST execution_cost
    ROWS result_rows
    SET configuration_parameter { TO | = } { value | DEFAULT }
    SET configuration_parameter FROM CURRENT
    RESET configuration_parameter
    RESET ALL

Description

ALTER ROUTINE 更改例程的定义,这个例程可以是聚合函数、普通函数或过程。请参阅 ALTER AGGREGATEALTER FUNCTIONALTER PROCEDURE 中的关于参数、更多示例和更多详细信息的说明。

Examples

为了将类型 integer 的例程 foo 重命名为 foobar

ALTER ROUTINE foo(integer) RENAME TO foobar;

此命令将独立于 foo 是聚合、函数或过程来执行。

Compatibility

此语句与 SQL 标准中的 ALTER ROUTINE 语句部分兼容。有关更多详细信息,请参阅 ALTER FUNCTIONALTER PROCEDURE 。允许例程名称引用聚合函数是 PostgreSQL 的一个扩展。

See Also

ALTER AGGREGATEALTER FUNCTIONALTER PROCEDUREDROP ROUTINE 请注意,没有 CREATE ROUTINE 命令。