ALTER FUNCTION

Function

ALTER FUNCTION modifies the attributes of a customized function.

Precautions

Only the owner of a function or a system administrator can run this statement. If a function involves operations on temporary tables, the ALTER FUNCTION cannot be used.

Syntax

Parameter Description

Examples

Alter the execution rule of the func_add_sql function to IMMUTABLE (that is, the same result is returned if the parameter remains unchanged):

1
ALTER FUNCTION func_add_sql(INTEGER, INTEGER) IMMUTABLE;

Change the name of the func_add_sql function to add_two_number.

1
ALTER FUNCTION func_add_sql(INTEGER, INTEGER) RENAME TO add_two_number;

Change the owner of the func_add_sql function to dbadmin.

1
ALTER FUNCTION add_two_number(INTEGER, INTEGER) OWNER TO dbadmin;

Helpful Links

CREATE FUNCTION, DROP FUNCTION